Using ActionScript 3.0 Components |
|
|
|
| Using the UI Components > Using the UILoader > Creating an application with the UILoader | |||
The following procedure explains how to add a UILoader component to an application while authoring. In this example, the loader loads a GIF image of a logo.
To create an application with the UILoader component:source parameter.This example creates a UILoader component using ActionScript and loads a JPEG image of a flower. When the complete event occurs, it displays the number of bytes loaded in the Output panel.
To create a UILoader component instance using ActionScript:
import fl.containers.UILoader;
var aLoader:UILoader = new UILoader();
aLoader.source = "http://www.flash-mx.com/images/image1.jpg";
aLoader.scaleContent = false;
addChild(aLoader);
aLoader.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(event:Event) {
trace("Number of bytes loaded: " + aLoader.bytesLoaded);
}
|
|
|
|