Weird SWFObject sizing issue in Firefox

I just ran into a weird SWFObject error on Firefox 3 on OS X. Basically, the app was not getting stage.stageWidth and stage.stageHeight set correctly when it loaded (it was getting 0 for both).

I saw what I believe is a related issue on the SWFObject issue tracker and the workaround suggested by Bobby there (to force a refresh on the loadEvent) works but causes an unsightly refresh on the movie.

The workaround I implemented was to pass in the actual width and height of movie via FlashVars. The movie uses these instead of stage.stageWidth and stage.stageHeight.

Finally, to clarify, this issue does not occur on Safari or when using the embed code generated by the Flash IDE.