package { import flash.events.Event; /** * ... * @author DYO */ public class MovieStatus extends Event { //▼カスタマイズ ココカラ /*-------------------------------------------------- * page --------------------------------------------------*/ static public const PAGE:String = "movieStatusPage"; static private var _page:int; static public function get page():int { return _page; } static public function set page(value:int):void { if(_page != value){ var _value = _page; _page = value; myDispatcher.dispatchEvent(new MovieStatus({type:PAGE,current:_page,pre:_value})); } } //▲カスタマイズ ココマデ static private var myDispatcher:MyDispatcher; public var status:Object; public function MovieStatus(_type:Object, bubbles:Boolean = false, cancelable:Boolean = false) { var type = _type is String ? _type : _type.type; super(type, bubbles, cancelable); status = _type is String ? {current:null,pre:null,type:type} : _type; } public override function clone():Event {return new MovieStatus(type);} static public function init() {if(!myDispatcher)myDispatcher = new MyDispatcher();} static public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void {myDispatcher.addEventListener(type, listener, useCapture, priority,useWeakReference);} static public function dispatchEvent(evt:Event):Boolean {return myDispatcher.dispatchEvent(evt);} static public function hasEventListener(type:String):Boolean {return myDispatcher.hasEventListener(type);} static public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void {myDispatcher.removeEventListener(type, listener, useCapture);} static public function willTrigger(type:String):Boolean {return myDispatcher.willTrigger(type);} } } import flash.events.Event; import flash.events.EventDispatcher; import flash.events.IEventDispatcher; class MyDispatcher implements IEventDispatcher { private var dispatcher:EventDispatcher; public function MyDispatcher() {dispatcher = new EventDispatcher(this);} public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void {dispatcher.addEventListener(type, listener, useCapture, priority);} public function dispatchEvent(evt:Event):Boolean {return dispatcher.dispatchEvent(evt);} public function hasEventListener(type:String):Boolean {return dispatcher.hasEventListener(type);} public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void {dispatcher.removeEventListener(type, listener, useCapture);} public function willTrigger(type:String):Boolean {return dispatcher.willTrigger(type);} }