Maybe try using callLater()? Sometimes if you're dealing with resizing
issues you've got to use callLater to make your code wait until the
visual display has been updated.
Did you try using the complete event instead? I don't know what fires
when, since we don't get the source of flash.display.Loader. But I think
all these events (init, complete, etc) fire regardless of scaling the
content (the events are actually in the Loader class). So those events
firing don't necessarily mean the SWFLoader has finished laying out the
content. So it might be possible for those events to fire before or
after the content has been resized. Or you could try to extend SWFLoader
and add a new event to fire once the content has been scaled, like at
the end of doScaleContent() for example.
Doug
sergewebkitchen wrote:
Hey guys,
I have an SWFLoader component in my project which has these settings:
maintainAspectRatio="true"
scaleContent="true"
I use a bit of code to load the content in.
printSnapshot.load(snapshotURL);
and add an eventListener:
printSnapshot.addEventListener("init", checkSnapshotLoaded);
That checkSnapshotLoaded function just launches a printjob.
No problem with that... But... The content in my SWFLoader is not
scaled! At least... not always... :-(
According to the docs, the init event gets dispatched when "All
properties and methods associated with the loaded object and those
associated with the control are accessible."
So this should work all the time... but sadly it doesn't... Anyone
have a suggestion to what may be going wrong? Or how to solve it?
Thanks a bunch,
Serge