1.先做一个蜻蜒的元件(movie) 记得翅膀要会动哦。哈哈
2。将元件拉入场景中。然后命名为qt. 选中qt,按F9键入如下代码:
onClipEvent (enterFrame) {
if (i == 360) {
i = 1;
}
setProperty(this, _rotation, i+=5);
/* if(_x>=Stage.width) {_x=1;}
setProperty(this, _x, _x+=random(10));
if(_y>=Stage.height) {_y=1;}
setProperty(this, _y, _y+=random(3));
*/
if (xflag) {
setProperty(this,_x,_x+=random(16));
if (_x>=Stage.width) { xflag=false; }
} else {
setProperty(this,_x,_x-=rando