package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
public class Test extends Sprite
{
public var _circle:MovieClip;
public function Test ():void
{
this._circle = new CircleMc();
//this._circle.addEventListener(Event.COMPLETE, onComplete);
this._circle.addEventListener(Event.ENTER_FRAME, this.onComplete);
addChild(this._circle);
this._circle.play();
/*_circle.onEnterFrame = function () {
trace (this._currentframe);
}
this._circle.x = 100;
this._circle.y = 100;
*/
}
public function onComplete(evt:Event):void
{
trace(evt.currentTarget.currentFrame);
var mc:MovieClip = evt.currentTarget as MovieClip;
if (mc.currentFrame != mc.totalFrames)
return;
this._circle.gotoAndStop(1);
this._circle.removeEventListener(Event.ENTER_FRAME, this.onComplete);
trace("complete!!!");
return;
}
}
}
flash监听机制(one by one)
最新推荐文章于 2018-04-18 11:11:18 发布