我们来看看怎么做: 其实这个很简单就是写个代码到主场景就完了.代码: aiyi_text = "这里改成你要输入的文字就好"; aiyi_len = aiyi_text.length; n = 0; while (naiyi_len) { _root.createEmptyMovieClip("aiyiT"+n, n); t = aiyi_text.substr(n, 1); with ……
我们来看看怎么做: 其实这个很简单就是写个代码到主场景就完了.代码: aiyi_text = "这里改成你要输入的文字就好"; aiyi_len = aiyi_text.length; n = 0; while (n<aiyi_len) { _root.createEmptyMovieClip("aiyiT"+n, n); t = aiyi_text.substr(n, 1); with (_root["aiyiT"+n]) { createTextField("aiyi_t", 2, 0, 0, 20, 20); aiyi_t.text = t; //trace(aiyi_t.text) } n++; } startDrag(aiyiT0, true); _root.onLoad = function() { speed = 3; }; _root.onEnterFrame = function() { aiyi = 1; while (aiyi<=_root.aiyi_len) { _root["aiyiT"+aiyi]._x += 5+(_root["aiyiT"+(aiyi-1)]._x-_root["aiyiT"+aiyi]._x)/speed; _root["aiyiT"+aiyi]._y += (_root["aiyiT"+(aiyi-1)]._y-_root["aiyiT"+aiyi]._y)/speed; aiyi++; } }; _root.Mouse.hide();
详细做法: 1.新建flash文档,大小随意 2.点击动作打开动作面板: 3.写入代码:只要复制进去就好了,然后把框起来的地方改成你要跟随的字。——教你做两种个性鼠标文字跟随www.jia12.com
4.然后点控制测试影片就好了.
1.打开flash,新建文档,大小随便设置下。——教你做两种个性鼠标文字跟随www.jia12.com
2.新建影片剪辑,方法:插入,新建元件,影片剪辑。(图我就不发了,上面有的) 3.在元件1里面写入你要跟随的第一个字,用文字工具。并且放在中间。用选取工具拖过去就可以了!(图片上面也有) 4.有必要的话下面属性里面的字体,颜色,大小改改。(上面也写了) 5.再新建影片剪辑,输入第二个字,和上面的步骤一样。 6.重复第五步直到达到你想要的字数。 7.返回场景,把刚刚建的元件全部拖入主场景。但是放到白色区域外面的灰色区域。 8.然后在属性面板里面写实例名,第一个字写t1,第二个字写t2,然后是t3,t4,t5,t6(注意哦,实例名一定要写对不然就只会有第一个字跟随的)
9.下面开始写代码,选中第一个字,右键动作,然后代码复制进去.也可以选中字然后点动作.( 图片不发了上面有) 10.和上面那步一样,把代码写进去.每个字一套代码,在下面! 然后测试下就完成了!
第一个字的代码: onClipEvent (load) { this._x = -2; this._y = -2; this._xscale = 80; this._yscale = 80; } onClipEvent (enterFrame) { if (this._x < _root._xmouse) { this._x = (this._x + (_root._xmouse - this._x) / 6) + 4; this._y = (this._y + (_root._ymouse - this._y) / 6) + 2; } if (this._x > _root._xmouse) { this._x = (this._x - (this._x - _root._xmouse) / 5) + 4; this._y = (this._y - (this._y - _root._ymouse) / 5) + 2; } }
第二个字的代码: onClipEvent (load) { this._x = -2; this._y = -2; this._xscale = 80; this._yscale = 80; } onClipEvent (enterFrame) { if (this._x < _root.t1._x) { this._x = (this._x + (_root.t1._x - this._x) / 6)+2 ; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y += (_root._ymouse - this._y) / 6; } if (this._x > _root.t1._x) { this._x = (this._x - (this._x - _root.t1._x) / 6) + 2; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y -= (this._y - _root._ymouse) / 6; } }
第三个字的代码: onClipEvent (load) { this._x = -2; this._y = -2; this._xscale = 80; this._yscale = 80; } onClipEvent (enterFrame) { if (this._x < _root.t2._x) { this._x = (this._x + (_root.t2._x - this._x) / 7)+1.4 ; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y += (_root._ymouse - this._y) / 6; } if (this._x > _root.t2._x) { this._x = (this._x - (this._x - _root.t2._x) /7) + 1.4; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y -= (this._y - _root._ymouse) / 6; } }
第四个字的代码: onClipEvent (load) { this._x = -2; this._y = -2; this._xscale = 80; this._yscale = 80; } onClipEvent (enterFrame) { if (this._x < _root.t3._x) { this._x = (this._x + (_root.t3._x - this._x) / 8)+1.3 ; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y += (_root._ymouse - this._y) / 6; } if (this._x > _root.t3._x) { this._x = (this._x - (this._x - _root.t3._x) / 8) + 1.3; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y -= (this._y - _root._ymouse) / 6; } }
第五个字的代码: onClipEvent (load) { this._x = -2; this._y = -2; this._xscale = 80; this._yscale = 80; } onClipEvent (enterFrame) { if (this._x < _root.t4._x) { this._x = (this._x + (_root.t4._x - this._x) / 6)+1.3 ; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y += (_root._ymouse - this._y) / 6; } if (this._x > _root.t4._x) { this._x = (this._x - (this._x - _root.t4._x) / 6) + 1.3; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y -= (this._y - _root._ymouse) / 6; } }
第六个字的代码: onClipEvent (load) { this._x = -2; this._y = -2; this._xscale = 80; this._yscale = 80; } onClipEvent (enterFrame) { if (this._x < _root.t5._x) { this._x = (this._x + (_root.t5._x - this._x) / 6)+1.3 ; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y += (_root._ymouse - this._y) / 6; } if (this._x > _root.t5._x) { this._x = (this._x - (this._x - _root.t5._x) / 6) + 1.3; this._y = (this._y + (_root._ymouse - this._y) / 5) + 2; //this._y -= (this._y - _root._ymouse) / 6; } }
第七个字也不知道, 这代码其实其他都一样,就是后面的坐标需要调一下,但是怎么调就不知道了. 只要调X坐标轴,不要调Y坐标轴。
|
|