Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-17-2007, 11:54 AM   #1
Chuck Taylor
AS 3.0 Donkey
 
Join Date: Feb 2007
Posts: 123
Default The 'stage' keyword

I thought 'stage' was a top level global variable. Apparently it isn't so. Even importing 'flash.display.Stage' doesn't help. How to refer to the stage object?

I have seen 'stage' being used in some of senocular's tutorials too. Eg:

Code:
stage.addEventListener(MouseEvent.MOUSE_UP, captureMouseUp);
Chuck Taylor is offline   Reply With Quote
Old 03-17-2007, 12:01 PM   #2
Paul Ferrie
Scottish and mad fer it!!
 
Paul Ferrie's Avatar
 
Join Date: Jun 2002
Location: uk/scotland/glasgow
Posts: 3,606
Default

have u tried Stage
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- InnovativeDesigns - Scotflash - About me
Paul Ferrie is offline   Reply With Quote
Old 03-17-2007, 12:15 PM   #3
Chuck Taylor
AS 3.0 Donkey
 
Join Date: Feb 2007
Posts: 123
Default

Yea, it doesn't work either.
Chuck Taylor is offline   Reply With Quote
Old 03-17-2007, 12:19 PM   #4
Paul Ferrie
Scottish and mad fer it!!
 
Paul Ferrie's Avatar
 
Join Date: Jun 2002
Location: uk/scotland/glasgow
Posts: 3,606
Default

Am at a loss and out of ideas
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- InnovativeDesigns - Scotflash - About me
Paul Ferrie is offline   Reply With Quote
Old 03-17-2007, 04:28 PM   #5
cybergatuno
Registered User
 
Join Date: Mar 2007
Posts: 5
Default

stage is no keyword, it's an attribute of all instances of DisplayObject and subclasses. When you write "stage.addEvent..." you're actually writing "this.stage.addEvent...". Again, it's only available in instances of DisplayObject.
cybergatuno is offline   Reply With Quote
Old 03-17-2007, 05:38 PM   #6
Chuck Taylor
AS 3.0 Donkey
 
Join Date: Feb 2007
Posts: 123
Default

Thanks a lot man. I get it now.
Chuck Taylor is offline   Reply With Quote
Old 03-17-2007, 07:51 PM   #7
Tink
Addict
 
Tink's Avatar
 
Join Date: Nov 2001
Location: London
Posts: 2,128
Default

the property is only available when your DisplayObject is actually in a display list. if its not in a display list it will return null.
Tink is offline   Reply With Quote
Old 03-18-2007, 07:10 PM   #8
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

There should be a section in the tip of the day tips that cover that.
__________________
(6)
senocular is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hittest not working off stage - sollution? Rasper ActionScript 2.0 3 04-20-2006 07:43 AM
Need help with timeline code! GaJl ActionScript 2.0 2 02-28-2006 02:09 PM
dynamically resizing the stage for a .flv player? ykol20 ActionScript 2.0 2 01-03-2005 02:38 PM
Stage Language in Strings Panel flashch ActionScript 2.0 0 08-23-2004 11:35 AM
loadmovie and SWF stage dimensions ahayes1ic ActionScript 1.0 (and below) 0 02-11-2004 08:08 AM


All times are GMT. The time now is 02:38 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.