0

I am trying to scale a swf that has been loaded via a swfloader. When I get the complete event or the init event the dimensions of the swfloader are still zero. I don't see a value in the dimensions until I do a resize of the browser window. The swf is just an animation. Trying to resize the actual swf content gives inconsistent results.

d b
  • 1

1 Answers1

0

For this kind of problem, it sometimes helps to simply poll the dimensions on enterFrame until you get some value. You could for example do this:

bool dimensionsSet = false
addEventListener("enterFrame", checkDimensions);

function checkDimensions(event:*):void {
    if (!dimensionsSet && width && height) {
        dimensionsSet = true;
        // Do initialization code
    }
}
laurent
  • 88,262
  • 77
  • 290
  • 428