开始联系actiongscript,发现自己写代码的熟练度太低了,是该好好练练,贴起来以提醒自己是一名程序员,是一名flash的fans.
- 跟随:
- 代码:
1 stop();
2 i = 1;
3 xStart = 100;
4 yStart = 100;
5 xd = 2;
6 yd = 2;
7 mc.lineStyle(1, ox000000, 100);
8 _root.onEnterFrame = function() {
9 var c = _root.createEmptyMovieClip("mc"+i, 100+i);
10 c.lineStyle(1, 0xff0000, 100);
11 c.moveTo(xStart, yStart);
12 xd = (_xmouse-xStart)*0.05;
13 yd = (_ymouse-yStart)*0.05;
14 c.lineTo(xStart += xd, yStart += yd);
15 if (i == 100) {
16 i = 1;
17 }
18 var line = _root.createEmptyMovieClip("linew"+i, i++);
19 line.lineStyle(0, 0x000000, 20);
20 line.moveTo(xStart, yStart);
21 line.lineTo(_xmouse, _ymouse);
22 if (i == 100) {
23 i = 1;
24 }
25 };
26 - demo