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.
Actionscript:
-
import org.puremvc.as3.interfaces.IFacade;
-
import org.puremvc.as3.patterns.facade.Facade;
as oppose to
Actionscript:-
import org.puremvc.interfaces.IFacade;
-
import org.puremvc.patterns.facade.Facade;
-
- there is a new way to notify observers:
Actionscript:
-
facade.sendNotification(PurelyKulerConstants.STARTUP, app);
as oppose to
Actionscript:-
facade.notifyObserver(new Notification(PurelyKulerConstants.STARTUP, app))
-
- 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.
So if you look at the last example I did, it was just about getting data from a Proxy to a Mediator.
This time I'm adding garbage collection and using the new, to ver2.3, onRemove method in IMediator to delete all the ui and variables. Like this.
-
override public function onRemove():void
-
{
-
vo.removeEventListener(MouseEvent.CLICK, changeColor);
-
vo.graphics.clear();
-
vo.parent.removeChild(_tf);
-
-
_tf = null;
-
_ka = null;
-
cc = undefined;
-
trace("_tf: " + _tf);
-
}
Alright enough typing, here it is. Click on a mediator name.
Last 5 posts in actionscript
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
- How to use Bitmap and BitmapData in ActionScript 3 - v2 - April 23rd, 2008
- How to use Bitmap and BitmapData in ActionScript 3 - v1 - April 21st, 2008
Last 5 posts in as3
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to load Pixel Bender in Flash Player 10 - May 19th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
- How to use Bitmap and BitmapData in ActionScript 3 - v3 - April 29th, 2008
Last 5 posts in flash
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to load Pixel Bender in Flash Player 10 - May 19th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
- How to use Bitmap and BitmapData in ActionScript 3 - v3 - April 29th, 2008
Last 5 posts in PureMVC
- How to create a PureMVC app with Actionscript 3 - February 13th, 2008
Josh Weatherspoon, A self-proclaimed millionaire who for some reason has to work as a Flash Developer, at Travelocity in Dallas(Southlake), TX.


Horaayy..there are 2 comment(s) for me so far ;)
thanks for these PureMvc posts - They're well commented and v helpful
you're welcome!