We help IT Professionals succeed at work.
Get Started

Flash 8 AS2 - Stage.width returns 0 in ie8

slightlyoff asked
Last Modified: 2013-11-11
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);
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE