チェンジセット 305
- コミット日時:
- 2008/03/26 01:58:03 (4 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/Commands/src/commands/FrameWaitCommand.as
r304 r305 3 3 import flash.events.Event; 4 4 import flash.display.Stage; 5 import flash.events.IEventDispatcher; 5 6 6 7 /** … … 10 11 public class FrameWaitCommand extends CommandBase 11 12 { 12 protected var maxCount:int13 13 protected var count:int 14 14 15 public static var stage:Stage 15 //onEnterFrameを受信する為に、enterFrameを発信できるクラスを渡す必要がある 16 public static var enterFrameBeacon:IEventDispatcher 16 17 17 18 public function FrameWaitCommand( count:int ) 18 19 { 19 this.count = maxCount =count;20 this.count = count; 20 21 } 21 22 22 23 override public function execute():void 23 24 { 24 if(! stage)25 throw new Error("FrameWaitCommand. stage should be set before you use FrameWaitCommand.execute");26 stage.addEventListener(Event.ENTER_FRAME, _enterFrameHandler, false, 0, true);25 if(!enterFrameBeacon) 26 throw new Error("FrameWaitCommand.enterFrameBeacon should be set to receive Event.ENTER_FRAME"); 27 enterFrameBeacon.addEventListener(Event.ENTER_FRAME, _enterFrameHandler, false, 0, true); 27 28 } 28 29 … … 31 32 { 32 33 if(count<=0){ 33 stage.removeEventListener(Event.ENTER_FRAME, _enterFrameHandler);34 IEventDispatcher(e.target).removeEventListener(e.type, arguments.callee); 34 35 this.dispatchComplete(); 35 36 }

