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: Multicore example please  (Read 5365 times)
Tipz
Full Member
***
Posts: 20


View Profile Email
« on: March 20, 2009, 03:48:49 »

Hi I have been trying to get my head around using mulitcore and flash as3. The more I read, the more I seem to get confused :-[. Could anyone please post a simple example using multicore? All the examples around are with flex and I have clue on flex. It would be nice to have a basic usage of multicore + flash or flashdevelop + as3.

Cheers
Logged
Ondina
Sr. Member
****
Posts: 86


View Profile Email
« Reply #1 on: March 22, 2009, 01:47:29 »

When I started with puremvc I collected / bookmarked all the examples/links I found on the forum.

Here are some for Flash:

These are the official puremvc examples

http://trac.puremvc.org/Demo_AS3_Flash_HelloFlash
http://trac.puremvc.org/Demo_AS3_Sequential ( has a standard and a multicore version)


Then here are links from purmvc members' sites

The Minimalist Example
http://www.as3dp.com/2007/12/27/minimalist-mvc-example-using-the-puremvc-framework/

http://blog.log2e.com/2008/05/17/getting-started-with-the-puremvc-startup-manager-part-2/

Flash CS3 Application Config Example source.
http://www.lfpug.com/puremvc/

Building a Flash site using PureMVC
http://hubflanger.com/building-a-flash-site-using-puremvc/

---
For the multicore version you only have  to adjust a few things:

The imports
replace
import org.puremvc.as3
with
import org.puremvc.as3.multicore

The FlashMain.as
import yourPath.ApplicationFacade;
public static const NAME:String = "FlashMain";
private var facade:ApplicationFacade = ApplicationFacade.getInstance( NAME );
facade.startup(this.stage)

The ApplicationFacade.as
import org.puremvc.as3.multicore.patterns.facade.Facade;
public function ApplicationFacade ( key:String )
{
   super( key );
}
       
public static function getInstance( key:String ) : ApplicationFacade
{
      if ( instanceMap[ key ] == null ) instanceMap[ key ] = new ApplicationFacade( key );
       return instanceMap[ key ] as ApplicationFacade;
}


I work with Flex, so maybe what I said above is not accurate. I didn't test it for Flash.

P.S.
PureMVC-enabling your Flash CS3 Installation:
http://trac.puremvc.org/PureMVC_AS3_MultiCore/wiki/Installation

onRegister comes after initializeNotifier, and is the recommended place to do any preparatory facade access (same for Standard version, though the demos haven't yet been changed). This insures that any 'conversations' that are started only happen once the actor is registered and capable of being retrieved or notified.

-=Cliff>
« Last Edit: March 22, 2009, 03:04:13 by Ondina » Logged

~ Ondina ~
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: March 22, 2009, 06:44:51 »

Thanks so much for responding to this one Ondina.

-=Cliff>
Logged
Tipz
Full Member
***
Posts: 20


View Profile Email
« Reply #3 on: March 23, 2009, 02:47:57 »

Thanks for your reply Ondina, but I have been through all those links, before starting this thread. The Sequential http://trac.puremvc.org/Demo_AS3_Sequential is the only example I found for multicore but its a demonstration of AsyncCommand utility. It would be great if someone could post a simple example of multicore and flash.

Thanks again
Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #4 on: March 23, 2009, 06:20:25 »

The only difference between the Flex multi-core demos and Flash is how you handle the loading of modules, everything else is the same. Since we don't have classes like Module in Flash, you have to use the loader class to load the module just as you would any external asset. It's really that easy.
Logged
Pages: [1]
Print