PureMVC Architects Lounge

PureMVC Manifold => Demos and Utils => Topic started by: puremvc on February 24, 2008, 07:13:17



Title: HelloFlash - A PureMVC AS3 / Flash Demo
Post by: puremvc on February 24, 2008, 07:13:17
This demo illustrates the use of the PureMVC framework within a Flash application. A lonlely little blue box appears, moving in a grey room. Interact with it.

The demo has historically been located here: http://trac.puremvc.org/Demo_AS3_Flash_HelloFlash
The project has been moved here: https://github.com/PureMVC/puremvc-as3-demo-flash-helloflash/wiki

The author is Cliff Hall.


Title: Re: HelloFlash - A PureMVC AS3 / Flash Demo
Post by: lordnahkim on July 23, 2008, 02:12:12
Hello Cliff - supreme work you've done here bringing a world-class framework standard to actionscript 3! Perfect timing too as its really been overdue for there to be something other than Cairngorm.  Bravo champ!


Title: Re: HelloFlash - A PureMVC AS3 / Flash Demo
Post by: aestheticsData on July 29, 2008, 02:38:25
thanks for the app. But is there a tutorial somewhere ?


Title: Re: HelloFlash - A PureMVC AS3 / Flash Demo
Post by: avdp on October 01, 2008, 05:20:51
Hi, just wanted to say: GREAT WORK!

this example is great for studying the framework.


Title: Re: HelloFlash - A PureMVC AS3 / Flash Demo
Post by: Tehk on October 13, 2008, 04:13:53
Hi,

i want to create a deck of cards, the helloFlash application is often refered to when it comes to dynamic use of multiple proxies/mediators.

but while looking at it i feel that it breaks some of the rules of mvc...

1. the component helloSprite.as hold a lot of information like xpos, color etc. shouldnt a proxy hold these? or at least the mediator?
2. the component has a timer event and listener -> that should be in the proxy too. the proxy would then notify the mediator that the position has changed, and the mediator would cahnge its components position...
3. component listens for mouseEvents -> mediator should do that


it really confuses me to see that application as an example of best practices when it comes to dynamic mediators...

what should i do?

thanks for the help!
-tehk


Title: Re: HelloFlash - A PureMVC AS3 / Flash Demo
Post by: puremvc on October 14, 2008, 07:40:26
Hi Tehk,

There's nothing wrong with a view component encapsulating its behavior and appearance. Compare the HelloSprite to a Flex button control, for instance:

Both listen for and respond to mouse events.

Both encapsulate their own appearance and behavior. A button greys itself out when disabled and doesn't allow interaction. It sets its own size based on its label, etc.

We don't bother to make a Proxy to hold all the properties that control appearance and behavior of a button. Nor do we use a mediator to control the button's access to the mouse.

Instead we encapsulate behavior and appearance in the view component and then expose an API of properties, methods, constants and events that allow modification of behavior and appearance by outside actors (such as mediators), subclasses, or even the class itself.

HelloSprite is merely a self driven actor. It calls its own API repeatedly. There is no need to keep a Proxy with all of the location  and appearance info for every Sprite when the sprit itself has that information and is the only actor that needs it.

As a result, If you wanted to use the HelloSprite in a non-PureMVC app, you could with very little difficulty.

-=Cliff>