Flash 8 AS2 - Stage.width returns 0 in ie8
Posted on 2010-01-12
For a while i was completly stumped trying to figure out why I couldn't use Stage.width to horizontally center my dynamically loaded .swf on the stage. I had a function that would center the .swf if the browser was resized, and that worked, but when the file was opened for the first time in the browser, the centering was way off. And it's because Stage.width is returning a 0.
Is there a work around for that? How can i determine a full screen width of a div?
Thanks for your help!!! Hope this makes sense.
This is the line i'm running to center the movieclip, it's at the beginning of my actionscript:
mc_movie._x = (Stage.width/2) - (mc_movie._width/2);