
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
156
|
Chapter 5: Authoring an ActionScript 2.0 Class
container_mc.border_mc.lineTo(w, 0);
container_mc.border_mc.lineTo(w, h);
container_mc.border_mc.lineTo(0, h);
container_mc.border_mc.lineTo(0, 0);
}
/**
* Loads a JPEG file into the image viewer.
*
* @param URL The local or remote address of the image to load.
*/
public function loadImage (URL:String):Void {
imageLoader.loadClip(URL, container_mc.image_mc);
// Create a load-status text field to show the user load progress
container_mc.createTextField("loadStatus_txt", statusDepth, 0, 0, 0, 0);
container_mc.loadStatus_txt.background = true;
container_mc.loadStatus_txt.border = true;
container_mc.loadStatus_txt.setNewTextFormat(new TextFormat(
"Arial, Helvetica, _sans",
10, borderColor, false,
false, false, null, null,
"right"));
container_mc.loadStatus_txt.autoSize = "left";
// Position the load-status text field
container_mc.loadStatus_txt._y = 3;
container_mc.loadStatus_txt._x = 3;
// Indicate that the image is loading
container_mc.loadStatus_txt.text = "LOADING";
}
/**
* MovieClipLoader handler. Triggered by imageLoader when data arrives.
*
* @param target A reference to the movie clip for which
* progress is being reported.
* @param bytesLoaded The number of bytes of target
* that have loaded so far.
* @param bytesTotal ...