Optionally - it is available after your application is 'added to stage.'

 

Rick Winscot

 

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Anderson
Sent: Friday, April 04, 2008 5:09 PM
To: [email protected]
Subject: RE: [flexcoders] When can I access the Stage Object?

 

Excellent - thanks all of you -

Your help is most appreciated,

Mike

-----Original Message-----
From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ]
On
Behalf Of Alex Harui
Sent: Friday, April 04, 2008 1:28 PM
To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
Subject: RE: [flexcoders] When can I access the Stage Object?

You have instant access to it via systemManager.stage

-----Original Message-----
From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ]
On
Behalf Of Muzak
Sent: Friday, April 04, 2008 11:24 AM
To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
Subject: Re: [flexcoders] When can I access the Stage Object?

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

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

----- Original Message -----
From: "Mike Anderson" <[EMAIL PROTECTED] <mailto:mike%40anderson.net> >
To: <[email protected] <mailto:flexcoders%40yahoogroups.com> >
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

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

--
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

 

<<image001.jpg>>

<<image002.jpg>>

Reply via email to