Application.applicationComplete
http://livedocs.adobe.com/flex/2/langref/mx/core/Application.html#eventSummary

Fires right after creationComplete, but the stage property will be available.


----- Original Message ----- 
From: "Mike Anderson" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, April 04, 2008 8:13 PM
Subject: [flexcoders] When can I access the Stage Object?


Hello All,

In my main <mx:Application> I am attempting to add an Event Listener to
the Stage Object, after the CreationComplete Event is triggered.  Upon
application startup, I get that wonderful error dialog stating:

    "Cannot access a property or method of a null object reference."

I want to play around with some validate() stuff, in order to speed up
my Flex Resizing issues.  This is what I have for my code:

private function onApplication_CreationComplete( event:FlexEvent ):void
{
    stage.addEventListener( Event.RESIZE, onStage_Resize );
}

private function onStage_Resize( event:Event ):void
{
    this.validateNow();
}

So the question is, is the Stage Object not yet available?  Do I need to
place this Event Listener on a Child Object contained within my
Application?

Any thoughts on this would be greatly appreciated :)

Mike


------------------------------------

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to