Found a bug? Or just a limitation? Either way, if you try loading Captivate-generated movies into a Loader instance, like this:
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest(”myCaptivate.swf”);
myLoader.width = 400;
myLoader.height = 300;
addChild(myLoader);
The result will be that the Captivate gets loaded but you won’t see it. You can hear it so long as you have sound in it. But you won’t see it. It doesn’t get rendered.
But if you have the same exact code as above, but without modifying the width/height properties of the Loader instance, then it renders fine.
3 Comments
Hello!
Very Interesting post! Thank you for such interesting resource!
PS: Sorry for my bad english, I’v just started to learn this language
See you!
Your, Raiul Baztepo
I also meet such a problem …. in Flash AVM3
After search a lot, I found the reason.
There are two ways to deal with such problem.
1: set the scaleX/Y property of the Loader.
2: We all do wrong using about the “Loader” Object to directly set the height and width of it.
You can not set the hight and width before the loading process finishing.
import flash.display.Loader;
import flash.net.URLLoader;
import flash.events.*;
var _loader:Loader=new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadingComplete);
_loader.load(new URLRequest(”http://www.thesquashracket.com/wallpapers/nature/165858ducks.jpg”));
addChild(_loader);
function onLoadingComplete(evt:Event) {
trace(["before resize",evt.target.content.height,evt.target.content.width]);
evt.target.content.height=100;
evt.target.content.width=100;
trace(["After resize",evt.target.content.height,evt.target.content.width]);
}
reference: http://www.actionscript.org/forums/archive/index.php3/t-150974.html