|
-
AS3 Stage.width not working??
I'm just getting started with AS3 - sorry for the stupid question. All I need to do is access the stage dimensions. I can't use Stage.width or Stage.stageWidth without getting this compile error: 1119: Access of possibly undefined property width through a reference with static type Class.
-
half as fun, double the price
Stage.width in AS2 was a static property off of the Stage class. In AS3 they are now class properties for the stage instance. The stage instance is accessible from the stage property of DisplayObject instances such as your main timeline.
code: //main timeline:
trace(stage.stageWidth);
http://www.kirupa.com/forum/showthre...13#post1952513
-
Won't work for me either, even if I write
this.width = stage.stagewidth;
No matter what I do, won't work
-
half as fun, double the price
 Originally Posted by Sid1120
Won't work for me either, even if I write
this.width = stage.stagewidth;
No matter what I do, won't work
capital W - stageWidth
-
Ok - I was using a capital S in Stage as if it were a class, but if it is lowercase to treat it as an instance it works. Thank you, Senocular!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|