论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > Flash AS教程
Tag:2.0,3.0菜鸟,游戏,,cs,技巧,源码,,文本,文字,函数,音乐,随机,拖拽,asp,access,xml,mc,视频教程

Flash AS制作鼠标感应发光的文字效果

文章类别:Flash AS | 发表日期:2010-3-7 8:40:12

AS3.0发光的文字效果实例

演示:


1、新建Flash文件,设置属性:宽高根据舞台上的影片剪辑多少设定,我这里为 550 × 200 ,背景黑色。图1:
sshot-1.png
2、选文本工具,在舞台上输入一些静态的本文。根据需要选择字型和字的大小。颜色选你喜欢的。图2:
sshot-2.png
3、选菜单=>修改=>分离,把文字打散。图3:
sshot-3.png
4、单选每一个字,右键单击转换为影片剪辑。命名根据你的需要,设定注册点为居中。图4:
sshot-4.png
全部完成后库如图5:
sshot-5.png
5、添加as层,选中第一帧,输入下列代码:

//Import tweenmax

import gs.*;  

//Loop through all the letters in the stage

for (var i=0; i < numChildren; i++) {  

        //Get a letter (movie clip) from the stage

        var mc:* = getChildAt(i);  

        //Add an MOUSE_OVER listener for the letter

        mc.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);  

        //Tween the letter to have a white glow

        TweenMax.to(mc, 0.2 , {glowFilter:{color:0xffffff, alpha:1, blurX:10, blurY:10}});

 

//This function is called when the mouse is over an letter

function mouseOverHandler(e:Event):void {  

        //Save the letter to a local variable

        var letter:MovieClip = e.target as MovieClip;  

        //Animate the letter.

        //We call the function scaleBack() when the tween is finished

        TweenMax.to(letter, 0.8 , {scaleX: -1, glowFilter:{color:0xff8800, blurX:20, blurY:20}, onComplete: scaleBack, onCompleteParams:[letter]});

 

//This function is called when a letter’s scaleX is -1

function scaleBack(letter:MovieClip):void {  

        //Animate the letter back to original state

        TweenMax.to(letter, 0.2 , {scaleX: 1, glowFilter:{color:0xffffff, blurX:10, blurY:10}});

}
6、完工,测试你的电影。

7、延伸:你可以把舞台上的影片剪辑更换为任何元素,任何颜色的光效果。

视频教程列表
文章教程搜索
 
Flash AS推荐教程
Flash AS热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058