How to add and remove Mediators in a actionscript-3 puremvc app
Mar30
So since PureMVC has updated twice and also I never talked about garbage collection of the app, I have refactored PurelyKuler to work with PureMVC 2.3. Thate are quite a few changes, some being:
- the framework is being ported to many languages like PHP, Ruby, Python, Coldfusion, C# and many others.
[as]import org.puremvc.as3.interfaces.IFacade;
import org.puremvc.as3.patterns.facade.Facade;[/as]
as oppose to
[as]import org.puremvc.interfaces.IFacade;
import org.puremvc.patterns.facade.Facade;[/as] - there is a new way to notify observers:
[as]facade.sendNotification(PurelyKulerConstants.STARTUP, app);[/as]
as oppose to
[as]facade.notifyObserver(new Notification(PurelyKulerConstants.STARTUP, app))[/as] - also the Mediators are can be named from outside the class, so you can have many instances of the class and remove specific instances and not all.public function PurelyKulerMediator(mediatorName:String = null, viewComponent:Object=null){
_tf = new TextField();super(NAME, viewComponent);// the colorContainer
}
Those are just a few.
Alright back to PurelyKuler.