eidiot Loving ActionScript 3

10Mar/10

Robotlegs Utility LazyMediator

中文:Robotlegs 的 LazyMediator 扩展

Robotlegs utility LazyMediator is for better performance in games.

How to use
  • Override the mediatorMap getter method in context to:
    return _mediatorMap || (_mediatorMap = new LazyMediatorMap(contextView, injector));
  • In the constructor of view classes add:
    new LazyMediatorActivator(this);
Why it
  • LazyMediatorMap don’t listen events of display list and check every added/removed view.
How it works
  • LazyMediatorActivator dispatchs LazyMediatorEvent when the view is added/removed from stage.
  • LazyMediatorMap listen to the LazyMediatorEvent from contextView then check the view.
  • http://twitter.com/mizi_sk Tom Mizi

    I am using your utils, it looks useful, but when I use <lazy:lazymediatormxmlactivator view=”{this}”> it doesn't register mediator.

    I have overriden mediatorMap getter and registered mediators as always.

    Do you know what could be the problem?</lazy:lazymediatormxmlactivator>

  • http://eidiot.net/en/ eidiot

    I’m sorry but I have never used Flex MXML so I can’t help you with your problem.