Loading External image files — Flash CS3

One of the improvements made in AS3 is how you load external content into your application. Some of the new changes make it easier for you to initiate and measure the progress of a download – something which was always a bit of a challenge in the AS2 world.

To load suppose an image(png file) to flash content or to a movieclip which is added in runtime. Let the image file be bird.png into a movieclip imageHolderMC. And imageHolderMC is on the stage or you have added that to stage.

var imgPath = “bird.png”;

var loader:Loader = new Loader();

var request:URLRequest = new URLRequest(imgPath);

loader.load(request);

imageHolderMC.addChild(loader);

:- Now you can see that the image is loaded into imageHolderMC. It is same as we doing loadMovie in AS2.

Njoy…………..

One comment

  1. [...] you have loaded any image files and added that into a movieClip as we did in Loading External Images  you would like to resize the image according to your need . Some times the loaded image is too [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*