Alex:

actually this is a simple as3.0 project compiling with the cmd line 
compiler.

Is the stage defined at the same time the the root object is available?
I am sure there are reasons but not having stageHeight as a global property
makes me confused as to why?

should any sprite (whether it is nothing) as long as it's added to the 
display list be
able to access the stage property?

Sorry, for the lame questions but I've been passing in the stageHeight, 
where
I can get, it to all my sub classes in their constructor... not ideal 
but I can only seem to get the stageHeight properly from one sprite.

I just can't figure out the rules of the stage why some sprites can 
access the stage.stageHeight
and others can not. the dreaded NULL OBJECT REFERENCE reminds me of our 
president.

By the way, do people mind pure AS3.0 questions on this list or is it 
better on flashcoders?
There's still a lot of as2.0centric questions over there and it seems 
like flexcoders are a
great source of information 3.0centric.

OK, good night, thanks for the help.
Patrick


Alex Harui wrote:
>
> If you’re doing that in a Flex app during its startup phase, there is 
> no stage until after applicationComplete is dispatched. It is an evil 
> trick we do to optimize startup time where the application and all of 
> its children are not on the stage until the children are measured and 
> layed out.
>
> IUIComponents have a systemManager property that has a valid stage 
> during startup and afterwards.
>
> -Alex
>
> ------------------------------------------------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] 
> *On Behalf Of *{reduxdj}
> *Sent:* Wednesday, March 07, 2007 8:17 PM
> *To:* [email protected]
> *Subject:* [flexcoders] simple stageHeight question
>
> I've been having issues with trying to get stageHeight from sprites.
>
> var _sprite:Sprite = new Sprite();
> addChild(_sprite)
> trace (_sprite.stage.stageHeight)
>
> give me null object reference... after it's been added to the display.
>
> And also why can't I just access it from any class that extends Sprite
> like this:
>
> this.stage.stageHeight or like super.stage.stageHeight;
>
> What's confusing is I am doing this with no problem in another place. I
> just want every
> sprite i make to be able to access this property. I guess I'm left
> creating a global variable.
>
> What's the trick with this?
>
> THanks,
> patrick
>
>  




------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/0It09A/bOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! 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