Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: HelloFlash - A PureMVC AS3 / Flash Demo  (Read 23715 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« 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.
« Last Edit: September 23, 2012, 12:17:25 by puremvc » Logged
lordnahkim
Newbie
*
Posts: 8


View Profile Email
« Reply #1 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!
Logged
aestheticsData
Newbie
*
Posts: 1


View Profile Email
« Reply #2 on: July 29, 2008, 02:38:25 »

thanks for the app. But is there a tutorial somewhere ?
Logged
avdp
Newbie
*
Posts: 1


View Profile Email
« Reply #3 on: October 01, 2008, 05:20:51 »

Hi, just wanted to say: GREAT WORK!

this example is great for studying the framework.
Logged
Tehk
Newbie
*
Posts: 4


View Profile Email
« Reply #4 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 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>
Logged
Pages: [1]
Print