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: AS3 - null viewComponent Mediator  (Read 6521 times)
reduxdj
Jr. Member
**
Posts: 11


View Profile Email
« on: April 13, 2008, 11:59:29 »

I was trying to use flash cs3 to create a new PureMVC implementation, and I'm having issues with a null viewComponent in my applicationMediator.

Here's a snapshot of my problem.  i'm going off of how my flex works with passing a reference to my app as "this", from my main MovieClass in flash cs3...

from my main class

   var app:ApplicationFacade = new ApplicationFacade();
   app.startup(this);


How come when I pass my instance of my app to my ApplicationFacade it is not null.  However, when i try to access it in my app mediator it is?


when I try to access app like below...

facade.registerMediator ( new InitialViewMediator("InitialViewMediator",app.initialView)   );


it's always null...  Are there some difference to view startups from cs3 to flex?

Thanks,
reduxdj
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: April 17, 2008, 11:56:04 »

Try this instead:
:
var facade:ApplicationFacade = ApplicationFacade.getInstance();
facade.startup(this.stage);

Also, I'm not sure how your startup method looks, but it should pass the reference to the app in the body of a Notification, probably named STARTUP, that will trigger a StartupCommand, that will create and register proxies and mediators.

-=Cliff>
« Last Edit: April 17, 2008, 12:01:23 by puremvc » Logged
Pages: [1]
Print