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 refactored with Reactions  (Read 9505 times)
Gilbi
Full Member
***
Posts: 22


View Profile Email
« on: May 25, 2009, 12:12:02 »

I've come to the conclusion that if you're the type of person who's going to use Fabrication in a project without the Flex Framework, then your work flow will likely follow Method 3:

http://blog.geewa.com/post/2009/03/16/Integrating-Flash-Professional-and-Flex-Builder-Using-SWC.aspx

download the files here:

http://www.allflashwebsite.com/files/hello_flash_with_module2.zip

 :-*

... also, see the README file to compile
Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #1 on: May 25, 2009, 01:01:07 »

It appears only the StageMediator uses Reactions? I was under the impression Reactions couldn't be used with Flash... did you change anything?

Your post is kind of vague and I'd love to find out more on what/how you got reactions working with Flash. I know I could dig through the code myself and find out but I think it would be worth wild to have it here for others.

Thanks.
Logged
Gilbi
Full Member
***
Posts: 22


View Profile Email
« Reply #2 on: May 25, 2009, 02:05:27 »

Sorry for the vagueness, this board doesn't exactly bring out the verboseness in me  ;D

The example only adds reactions in the StageMediator, but as an exercise you could go ahead and replace all of the event handlers in the other mediators with reactions (make sure they extend FlashMediator or FabricationMediator). The reason I left it this way is because the original HelloFlash example demonstrated using Fabrication in some mediators, and not using it in others, so I thought that I would continue this tradition.

I don't fully understand Darshan's comments about Reactions not working in Flash, maybe he meant that specifically for when you're compiling with Flash CS3 you can't use reactions. As for how I got it to work, I really didn't do anything special. In this example, only the SWC file is compiled in CS3... without any classpath....and without any code... basically just the graphics are compiled in the SWC. The actual SWFs are compiled using the Flex SDK.

Technically you might want to call this a PureAS3 project, but Flash CS3 is used for creating purely graphical elements without any code attached. The actual view components are creating by composing these CS3 elements into a class, as opposed to how it was done before with inheritance. (I actually find this composition method more intuitive vs inheritance method, and the code hinting also makes it a sexy work-flow)
Logged
Pages: [1]
Print