Mike T. Henderson

I make interactive things.

Categories:


More Mike:

Flash AS3 Stage Class Display Issue with FireFox 3.0

September 10, 2008

Since updating my FireFox to version 3.0 on Mac, I've noticed that in a few of the Flash AS3 files that I've created, they don't always display correct. Only certain parts of the file would display, others would never rendor. I tested these files in various browsers and it only seemed to be FF3. FF2 worked fine, FF2, and FF3 on Windows worked great.  Hell, even IE got it right. With the browser tests, I was also able to notice that the display issue only happened when I was using add-ons in FF3. It wasn't any particular add-on, just whenever I used any add-on.

After doing a series of traces through various parts of the Flash I was able to pin-point when and where the issue was happening. It seemed that the the file would stop rendoring itself any time I used stage.stageWidth and/or Height. Everything was good with the syntax, but for some reason it just wasn't working. So I then traced the stageWidth and Height to a text box in various parts of the file and got 0's throughout.

It seems that for some reason or another, on FF3 on a Mac, when any add-on is enabled, the file loads before Flash can figure out the stageWidth and Height. So actually, it's not that my files weren't displaying correct, or that the FF3 add-ons were buggin it out, it's just that FF3 was loading faster than Flash could read the display list to receive the stage dimensions -- or at least that's how I see it. This then caused my display objects dependent on these dimensions, to not finish rendoring. Kind of curious why this only happens when the add-ons are enabled -- no idea.

The fix then, if you can't hard code the dimensions, is to run a timer until the stageWidth and/or Height is greater than 1. Then once it's greater, run the remainder of your script. I know there has to be an easier fix than that, or possibly an EventListener I'm just not finding, but for now this seems to work fine. If anyone knows, or has any other insight on this, I'd love to here it.

0 Comments | Posted under Browsers Bookmark and Share

No Comments »

No comments yet.

Leave a comment