文件名称:flash 练习-方形移动
文件大小:1KB
文件格式:SWF
更新时间:2014-05-24 09:53:53
flash 方形移动
代码如下: var i:int=0; var w:Number; var h:Number; one_fangxing.addEventListener(Event.ENTER_FRAME, fl_RotateContinuously_4); function fl_RotateContinuously_4(event:Event) { if(i<=0) { w=one_fangxing.width; h=one_fangxing.height; //trace("初始宽度= " + w +" 初始高度= " + h); } if(i<=90) { one_fangxing.rotation +=1; } else { one_fangxing.rotation =0; one_fangxing.x+=one_fangxing.height; one_fangxing.width=h; one_fangxing.height=w; i=-1; //trace("现在宽度= " + one_fangxing.width +" 现在高度= " + one_fangxing.height); //trace("方形的X坐标: "+ one_fangxing.x); if(one_fangxing.x>=480) { one_fangxing.x=0; } } i++; }