Created
March 11, 2010 22:15
-
-
Save destroytoday/329739 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import flash.utils.setTimeout; | |
import org.osflash.signals.Signal; | |
import org.robotlegs.mvcs.Mediator; | |
public class ViewMediator extends Mediator { | |
[Inject] | |
public var signalBus:ApplicationSignalBus; | |
[Inject] | |
public var view:View; | |
public function ViewMediator() { | |
} | |
override public function onRegister():void | |
{ | |
view.constructed.add(signalBus.viewConstructed); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import flash.utils.setTimeout; | |
import org.osflash.signals.Signal; | |
public class View extends Sprite { | |
public const constructed:Signal = new Signal(View); | |
public function View() { | |
setTimeout(constructed.dispatch, 2000.0, this); // delayed just to make sure the listener is added | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment