>> 最新文章
>> 阅读排行
>> 推荐文章
Flash特效制作:用flash绘制打字效果
点这里下载演示效果文件
点这里下载源文件
第一步,运行flash mx,新建文档,Ctrl+J打开文档属性对话框,设置为图1所示。
screen.width-333)this.width=screen.width-333" border=0>
第二步,使用文本工具输入动态文本,并设置动态文本的变量为“mytext”。如图2所示。
screen.width-333)this.width=screen.width-333" border=0>
第三步,在第2帧处按F6插入关键帧,并设置第2帧中动态文本的变量为“newtext”,在第4帧处按F5插入帧。图3。
screen.width-333)this.width=screen.width-333" border=0>
第四步,新建图层“脚本”,在“脚本”层第1帧中加入脚本:
screen.width-333)this.width=screen.width-333" border=0>
第七步,保存,Ctrl+回车测试。
点这里下载源文件
第一步,运行flash mx,新建文档,Ctrl+J打开文档属性对话框,设置为图1所示。
screen.width-333)this.width=screen.width-333" border=0>第二步,使用文本工具输入动态文本,并设置动态文本的变量为“mytext”。如图2所示。
screen.width-333)this.width=screen.width-333" border=0>第三步,在第2帧处按F6插入关键帧,并设置第2帧中动态文本的变量为“newtext”,在第4帧处按F5插入帧。图3。
screen.width-333)this.width=screen.width-333" border=0>第四步,新建图层“脚本”,在“脚本”层第1帧中加入脚本:
n=1//初始化变量
第五步,在“脚本”层第2帧插入关键帧,加入脚本:n++;//变量n自加
newtext = mytext.substr(0,n)//substr是字符串截取函数,从第1个字符开始到长度为n的字符
if (n>mytext.length) {
//mytext.length是字符串mytext的长度,当n的长度等于字符串mytext的长度时,停止播放。
stop();
}
第六步,在“脚本”层的第4帧插入关键帧,输入脚本:newtext = mytext.substr(0,n)//substr是字符串截取函数,从第1个字符开始到长度为n的字符
if (n>mytext.length) {
//mytext.length是字符串mytext的长度,当n的长度等于字符串mytext的长度时,停止播放。
stop();
}
gotoAndPlay(2);
图4
screen.width-333)this.width=screen.width-333" border=0>第七步,保存,Ctrl+回车测试。
| Copyright ©
2006-2008 Powered by PC中国-中国计算机网 All Rights Reserved 技术支持QQ:12908657 ICP经营许可证:沪ICP备05021190号 |


当前位置: