Size: XS

My Blog

Pulling in external jpgs with AS3

This is something I have done and forgotten so many times. So lets try add it here as a reminder.
To add an image to flash.

import flash.display.Loader;
import flash.net.URLLoader;
myImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaderReady);
var fileRequest:URLRequest = new URLRequest(“XXX.jpg”);
myImageLoader.load(fileRequest);
public function onImageLoaderReady(e:Event) {
       myContainer.addChild(myImageLoader);
}
Credits to Kirupa once again, a site with so much useful information