Skip to content

Instantly share code, notes, and snippets.

@destroytoday
Created March 11, 2010 22:15
Show Gist options
  • Save destroytoday/329739 to your computer and use it in GitHub Desktop.
Save destroytoday/329739 to your computer and use it in GitHub Desktop.
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);
}
}
}
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