PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: quinrou on July 16, 2007, 07:20:01

Title: Flash Demo?
Post by: quinrou on July 16, 2007, 07:20:01

I am a Flash programmer and although I understand what you've done in Flex I have some little problems to apply to Flash as I don't want to start invoking or declaring function/command at the wrong place.

So I was wondering if you had any Flash examples with where you are using the framework. Even a very simple one would do...

Coz at the moment I am only sort of guessing what I am doing.
i.e. Flash uses a Document Root Class to initialise the application. So I'm guessing that's where I have to instanciate the ApplicationFacade, correct?

Flash Examples please?


Title: Re: Flash Demo?
Post by: puremvc on July 16, 2007, 05:46:23

Yes, you can create a class extending MovieClip set it as the Document Root class and initialize the Facade from there. Or could instantiate it on a MovieClip instance on the Stage if the movie is going to be timeline based.

Your major concern will be in how to prepare the View.

In an MXML application, the Application object takes care of building all the initial View Components, and they're alive and waiting to have Mediators connected to them by the time you send a Notification (on creationComplete) to prepare the Model and the View.

This needs to happen differently in Flash. I will put a example online soon, I promise!  :)


Title: Re: Flash Demo?
Post by: quinrou on July 19, 2007, 09:31:13
Thanks Clif, looking forward to see the examples.

yes that's what I gathered about the AppliocationFacade. I created an Application Class which extands Sprite and that the instanciates the ApplicationFacade.

So far I have managed to get 2 buttons (mediators) working and they send notifications. the next step is to modify the state of another mediator when those notication happen i.e. go to a different frame label.

While wating for that Flash example I will carry on trying to crack the Framework with Flash. The way things work are very similare to other framework. I just need to find time to sit down and experiment..

Looking forward to see the examples


Title: Re: Flash Demo?
Post by: puremvc on July 29, 2007, 08:13:46

Didn't forget about you. Or the other hundred gajillion Flashers out there in need of a AS3 framework. HelloFlash is here. I'll get more detailed info about how it works up there, but for now it's all internally documented and shouldn't be terribly hard to follow.

Be sure to check out the detailed instructions on the PureMVC download page for setting up with Flash. Then getting the demo up in the Flash IDE is a breeze.


Title: Re: Flash Demo?
Post by: quinrou on August 01, 2007, 01:31:17
Hi Cliff,

Thanks so much for this. I will download the demo and see what the differences between mine and yours. I actually made great process since my last post as I am now now using Flash just to produce the asset and using FlashDevelop combine with ANT and the mxmlc compiler to create the final swf.

The Workflow is very efficient and very much like the way I am working in AS2 which is FlashDevelop+ANT+MTASC with pixlib (AS2 framework).

Thanks so much again for the example.


Title: Re: Flash Demo?
Post by: puremvc on August 01, 2007, 03:32:50

Good to hear it's been going well for you.

Sounds like you've got a good workflow going there. I wonder if you might have time to document it in a separate post that would possibly guide new Flash programmers coming to PureMVC. There are a lot of ways to do things, but if you've found one that you feel you can really be productive with, I'm sure others would really appreciate it.