How to add and remove Mediators in a actionscript-3 puremvc app

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:

  1. 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]
  2. 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]
  3. 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.

(more…)

3 comments March 30th, 2008

Mrs. Spitzer’s thoughts during her husbands sex scandal press conference

Mrs. Spitzer has a lot to think about. – Link

Add comment March 12th, 2008

Hilary Clinton’s Advice to NY Governor’s wife – Bitstrips is awesome

She’s good! -Link

Add comment March 12th, 2008

I smell a lawsuit

I was doing a search for Adobe AIR books coming out and found this. Who’d a thunk it!

adobeair.jpg

Add comment March 2nd, 2008

How to use the FileSystem in AIR to find the users directory folders

I was messing around last night with AIR and I stumbled apon this:

  1. start an AIR app in flash cs3
  2. add a list component
    1. name it dir_list
  3. drop the code below in the actions panel
  4. And Viola!
  5. PS – PC people, I put a test to see if My Documents in in that Directory.

filestream.jpg

[as]

import flash.filesystem.*;

var userDirFiles:Array = File.userDirectory.getDirectoryListing();
for (var i:uint = 0; i < userDirFiles.length; i++) {
if (userDirFiles[i].isDirectory) {
//this.display_txt.text = String(userDirFiles[i].nativePath);
dir_list.addItem({label:userDirFiles[i].nativePath })
var tmpString:String = userDirFiles[i].nativePath;
if(tmpString.search(/My Documents/) != -1)
{

dir_list.addItem({label:”working”});
break;
}
}
} [/as]

Add comment March 1st, 2008

I heart FOX/NBC Universial hulu

hulu logoSo I love being on the computer and I love exploring the world of flash. Sometimes that poses a problem because I like watching tv (my tv is not near my computer) and not having to wait for it to download through torrents. So I found through Mashable, hulu.

hulu.jpg

Hulu is nice all around. It works 10x better then ABC’s player. The interface is nice, it gives you the lots of info on the video like when it aired, and who was in it. I enjoy the face that you can gray out everything on the page to focus your eyes on the video not the dumb banner ads.

Lastly the best thing is you can embed it anywhere. Why? Because somebody smart though let’s not restrict where the video can play and allow the ads to stream in no matter where it’s embedded. I have a Simpsons episode from last week on my myspace.

Check hulu out.

Add comment February 27th, 2008

How to create a PureMVC app with Actionscript 3

Update at: How to Add and Remove Mediators in an Actionscript 3 PureMVC App

PureMVC imageSo I have been working alot w/ PureMVC, well everyday for the last month to be exact. I’m going to try to explain PureMVC the best way I know how. It may not be the best, but I hope it can get you started. And when you learn something let me know.

So the example I am doing is a simple one using Lee Brimelow’s code from the ActionScript 3 Advanced XML example. The only difference between his and what I changed is some method name changes and putting it in PureMVC.

So if you don’t know what PureMVC is or you are quite confused on how to use it…well so am I . I’m still learned and hopefully can teach some stuff. I’m not going to go into the specifics of this framework but think of it as a way to introduce a lot separation of code using the Model, View, Controller. I’ll explain what I see as the benefits after I explain the example.

(more…)

4 comments February 13th, 2008

Yahoo Maps ActionScript 3.0 Released

I didn’t think this was going to happen with Yahoo Maps going Ajax and the maps hack they released last year (Yahoo! Maps API Flex 2 Communication Kit).

Check it out: http://developer.yahoo.com/flash/maps/

Add comment February 11th, 2008

Update: Flash/Flex Tidbit #2 How to use Alpha Mask in Flash CS3

Someone asked me to give an example of the alpha masking in flash. So here is an example.

Source

Add comment January 8th, 2008

My thoughts on the writers strike

Though Jay Leno and Conan are coming back, there’s still a strike. My advice to you if you are trying to find something to do is, Code more!

Add comment December 27th, 2007

Next Posts Previous Posts


About This Blogger

Josh Weatherspoon is a Flash Platform Developer and self-proclaimed millionaire who still has to work at Travelocity in Dallas(Southlake), TX

Feeds

Most Recent Posts

Categories

Links

29

Find a Ultrasound school near you