Can't set width and height to the backgroundn
Hi guys I can't set开发者_运维问答 the width and height to backgrounds
I have an empty movieclip in the stage that holds a background
bg._width = Stage.width;
bg._height = Stage.height;
the background is loaded from XML and works fine since I'm not set the width and height
but if I set: bg._width = Stage.width and bg._height = Stage.height
Flash gives me white background??
Sounds like you may be running into an issue because you're trying to use stage.width instead of stage.stageWidth.
Here's a blog post explaining the difference: http://blog.pekpongpaet.com/2008/08/13/flash-actionscript-stagestagewidth-vs-stagewidth/
If your only content is a movieclip that's empty, stage.width == 0. Try stage.stageWidth etc and you should be good! :)
精彩评论