Flash鼠标特效精选实例(1)
第一节:3D鼠标跟随
该实例实现的是一3D小球随“鼠标”跟随效果,在制作过程中主要使用了自定义函数进行影片控制,大量使用了循环语句和赋值语句。影片最终播放效果如图1.1所示:

图1.1 影片最终效果
1.新建一影片,通过属性面板设置其大小为600pxX450px(单位为象素)背景色为#000000。
2.新建一影片剪辑“Sphere”,选取“椭圆工具”,在工作区中绘制一椭圆,并去掉其轮廓。打开“混色器”面板进行如图1.2所示的设置:

图1.2 设置“混色器”面板
3.应用上面设置的填充色填充绘制的圆,并通过“填充渐变”工具设置其光线注入点效果使之给人一种很强的立体感,效果如图1.3所示:

图1.3 制作“sphere”
4.新建一影片剪辑“coursor”用线条工具在工作区中绘制如图1.4所示的鼠标图案,并设置其填充色为白色,并去除其轮廓线:

图1.4 鼠标制作
5.新建一影片剪辑“animation”,将默认图层命名为“animation”,“ animation”只有一个图层,同时只有四帧。下面将分别为这四个关键帧进行相应设置
选中第1关键帧,添加如下ActionScript脚本代码:
// creazione della classe PuntoSpaziale
function PuntoSpaziale (x, y, z, target) {
// propriet?
this.target = target;
this.x = x;
this.y = y;
this.z = z;
this.firstx = x;
this.firsty = y;
this.firstz = z;
this.DFOWA = 100;
// Distance From Object World Axes
this.DFPP = 200;
// Distance From Proiection Plain
this.ScreenCenter_x = 300;
this.ScreenCenter_y = 200;
this.speed2dx = 0;
this.speed2dy = 0;
// metodi
this.Coord2DRelativeTo = Coord2DRelativeTo;
this.Coord3DRelativeTo = Coord3DRelativeTo;
this.Rotate = Rotate;
this.Scale = Scale;
this.UScale = UScale;
this.Traslate = Traslate;
this.Proiection_y = Proiection_y;
this.Proiection_x = Proiection_x;
this.DrawPoint = DrawPoint;
// funzioni che definiscono i metodi
function Coord3DRelativeTo (x1, y1, z1) {
// cambio di coordinate 3D in riferimento ad un
该实例实现的是一3D小球随“鼠标”跟随效果,在制作过程中主要使用了自定义函数进行影片控制,大量使用了循环语句和赋值语句。影片最终播放效果如图1.1所示:

图1.1 影片最终效果
1.新建一影片,通过属性面板设置其大小为600pxX450px(单位为象素)背景色为#000000。
2.新建一影片剪辑“Sphere”,选取“椭圆工具”,在工作区中绘制一椭圆,并去掉其轮廓。打开“混色器”面板进行如图1.2所示的设置:

图1.2 设置“混色器”面板
3.应用上面设置的填充色填充绘制的圆,并通过“填充渐变”工具设置其光线注入点效果使之给人一种很强的立体感,效果如图1.3所示:

图1.3 制作“sphere”
4.新建一影片剪辑“coursor”用线条工具在工作区中绘制如图1.4所示的鼠标图案,并设置其填充色为白色,并去除其轮廓线:

图1.4 鼠标制作
5.新建一影片剪辑“animation”,将默认图层命名为“animation”,“ animation”只有一个图层,同时只有四帧。下面将分别为这四个关键帧进行相应设置
选中第1关键帧,添加如下ActionScript脚本代码:
// creazione della classe PuntoSpaziale
function PuntoSpaziale (x, y, z, target) {
// propriet?
this.target = target;
this.x = x;
this.y = y;
this.z = z;
this.firstx = x;
this.firsty = y;
this.firstz = z;
this.DFOWA = 100;
// Distance From Object World Axes
this.DFPP = 200;
// Distance From Proiection Plain
this.ScreenCenter_x = 300;
this.ScreenCenter_y = 200;
this.speed2dx = 0;
this.speed2dy = 0;
// metodi
this.Coord2DRelativeTo = Coord2DRelativeTo;
this.Coord3DRelativeTo = Coord3DRelativeTo;
this.Rotate = Rotate;
this.Scale = Scale;
this.UScale = UScale;
this.Traslate = Traslate;
this.Proiection_y = Proiection_y;
this.Proiection_x = Proiection_x;
this.DrawPoint = DrawPoint;
// funzioni che definiscono i metodi
function Coord3DRelativeTo (x1, y1, z1) {
// cambio di coordinate 3D in riferimento ad un

