开发者

Can't set width and height to the backgroundn

开发者 https://www.devze.com 2023-02-01 20:08 出处:网络
Hi guys I can\'t set开发者_运维问答 the width and height to backgrounds I have an empty movieclip in the stage that holds a background

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! :)

0

精彩评论

暂无评论...
验证码 换一张
取 消