> flash > 杂乱整理flash里鼠标左右移动图片移动代码
作者: 来源: 日期:2008/6/26 10:54:34 人气:
标签:
1.在flash第一帧的帧上插入如下代码 function moveGraphic(clip, speed) { if (_root._xmouse >= right && this._x > right) { clip._x = clip._x + (right - clip._x) / 1; } else if (_root._ymouse >= bottom && clip._y > bottom) { clip._y = clip._y + (bottom - clip._y) / 1; } else { clip._x = clip._x - (clip._x + _xmouse * speed); clip._y = clip._y - 0; } // end else if } // End of the function stop (); var right = 1004; var bottom = 620; var speed; var clip; var nInterval = setInterval(moveGraphic, 10, clip1, 2.000000E-001); var n1Interval = setInterval(moveGraphic, 10, clip2, 1.500000E-001); var n2Interval = setInterval(moveGraphic, 10, clip3, 3.000000E-001); var n2Interval = setInterval(moveGraphic, 10, clip4, 2.500000E-001);
2.新建影片一,影片的名称为clip2 3.新建影片二,影片的名称为clip3
运行就可以了 |
|