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: Using a simple shell swf loader in a puremvc app  (Read 6787 times)
eco_bach
Courseware Beta
Sr. Member
***
Posts: 81


View Profile Email
« on: July 21, 2009, 08:41:30 »

Can someone calrify how I would use a simple shell loader as outlined in Lee Brimelows tutorial
http://www.gotoandlearn.com/play?id=85

As I understand it, everything in a PureMVC app starts with the startup command, called via your main document class via application facade.

But using Lee Brimelows shell loader technique requires at a minimum 2 swfs, your preloader shell, and the main application swf you are loading.

Where would the following code go
ApplicationFacade.getInstance().startup( this );

in your preloader 'shell' swf (only called after your main swf has loaded),
OR
in your main application swf?
Logged
eco_bach
Courseware Beta
Sr. Member
***
Posts: 81


View Profile Email
« Reply #1 on: July 21, 2009, 09:01:36 »

I think perhaps the answer is simply to ensure your main content swf has a stage reference BEFORE you call the startup command

So in you main swf
addEventListener(Event.ADDED_TO_STAGE,onadded);
trace('BEFORE onadded stage==='+ stage);


function onadded(e:Event):void{
   ApplicationFacade.getInstance().startup( stage );
   trace('AFTER onadded stage==='+ stage);
   
}
Logged
Pages: [1]
Print