Title: null value in flashVars vo causing error Post by: landed on October 06, 2009, 08:41:49 I'm running my first flex application via pmvc and am having an issue, namely when I try and access or pass the stage here as im doing the view prep command, exactly following the flex demo skeleton application
public class ViewPrepCommand extends SimpleCommand The difference is that my model prep is happening immediately as I havent any code in there yet but still I would have thought that the stage might be ready at this point since the flex application tag has sent through its complete handler. public function StageMediator(viewComponent:Main) inside the constructor of the flashVars value object null is the traceable parameter though it looks to be passed in ok.. Title: Re: null value in flashVars vo causing error Post by: landed on October 06, 2009, 08:58:48 I hadnt passed in any flash vars yet, so it was null for that reason ! I put in try catch now to stop the error. Not a pmvc thing.
Title: Re: null value in flashVars vo causing error Post by: landed on October 07, 2009, 02:33:59 There is something funny here - I aint laughing though
public function StageMediator(viewComponent:Main) viewComponent traces as Main0 and stage is null, which is strange maybe when the casting is tried ? Is this a flex strangeness, I have discovered a difference in the way that flex and flash work with pmvc is that a lot of view classes get built before the framework has done its thing. This is going to be an issue. Unless I keep the application tag only in the main entry point and instantiate the mxml later using as. Title: Re: null value in flashVars vo causing error Post by: landed on October 07, 2009, 02:45:12 the passed in value from the application tag is not the same as it is for regular flash
the passed notification is listed as Notification Name: startup Body:Main0 Type:null at least I have some clues, I just cant seem to get stage from the body "Main0" which apppears to be the Application class itself not the stage, here is where my flex knowledge is a bit flakey Title: Re: null value in flashVars vo causing error Post by: landed on October 07, 2009, 02:50:22 In the cafe townsend example we see that stage doesnt really exist we somehow loose that concept but instead get a ref to the app
/** I'm not sure how to really work without a stage so much this is an important point you may have also been struggling with. Again not really a puremvc issue but worth making. Title: Re: null value in flashVars vo causing error Post by: landed on October 08, 2009, 06:59:04 SOLVED :
FLEX: public function StageMediator(viewComponent:Object) |