loading external images

to load an image in flash is easy and only take a few lines of actionscrit

var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
var fileRequest:URLRequest = new URLRequest("myImage.jpg");
myLoader.load(fileRequest);
function onLoaded(e:Event) {    
      // the image is now loaded, so let's add it to the display list!    
      addChild(myLoader);
}

I used the above image, but you can use any image at all, If you don’t use Snoopy just make sure to change the movie size to at least match the size of your image.

Leave a Reply