Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Flash ActionScript Load External Image Tutorial

The loading of external images with Flash ActionScript 3 are basically involves the following steps:

  1. Create a new instance of the Loader class to work with.
  2. Create a new URLRequest object specifying the location or URL of the external image file.
  3. Call the load( ) method to load the external file with the URLRequest object as the parameter.
  4. Add the Loader instance to the display list using the addChild() method.

The Flash ActionScript loading external image can be illustrated with the following diagram:

flash actionscript 3 load external image file

Flash ActionScript Codes:

// Create a new instance of the Loader class to work with
var myLoader:Loader=new Loader();

 

// Create a new URLRequest object specifying the location of the external image file
var myRequest:URLRequest=new URLRequest("logo.png");

 

// Call the load( ) method load the external file with URLRequest object as the parameter
myLoader.load(myRequest);

 

// Add the Loader instance to the display list using the addChild() method
addChild(myLoader);

 

 

Remarks:

The Loader object is a DisplayObject that can load external object into. Since the loader is a display object therefore it can be added to the display list using the addChild() method, thus render and drawn on the screen.