大家好,我是小夏,我来为大家解答以上问题。flash如何实现鼠标经过,flash鼠标跟随代码很多人还不知道,现在让我们一起来看看吧!
1、var my_fmt:TextFormat = new TextFormat();
2、 my_fmt.color = 0x0000FF;
3、 i_text = "再美的故事,也会有一个结局。 ";
4、 i_len = i_text.length;
5、 n = 0;
6、 while (n<i_len) {
7、 _root.createEmptyMovieClip("iT"+n, n);
8、 t = i_text.substr(n, 1);
9、 with (_root["iT"+n]) {
10、 createTextField("i_t", 2, 0, 0, 20, 20);
11、 i_t.text = t;
12、 i_t.setTextFormat(my_fmt);
13、 //trace(aiyi_t.text)
14、 }
15、 n++;
16、 }
17、 startDrag(iT0, true);
18、 _root.onLoad = function() {
19、 speed = 3;
20、 };
21、 _root.onEnterFrame = function() {
22、 i = 1;
23、 while (i<=_root.i_len) {
24、 _root["iT"+i]._x += 5+(_root["iT"+(i-1)]._x-_root["iT"+i]._x)/speed;
25、 _root["iT"+i]._y += (_root["iT"+(i-1)]._y-_root["iT"+i]._y)/speed;
26、 i++;
27、 }
28、 };
29、 _root.Mouse.hide();
本文到此讲解完毕了,希望对大家有帮助。