MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 831

Components language reference
Table of Contents

Advertisement

Parameters
An optional parameter that specifies the value for the
path
the load begins. If a value is not specified, the current value of
Returns
Nothing.
Description
Method; tells the loader to begin loading its content.
Example
The following example creates a Loader instance,
loader
property to
autoload
method is made. Next the example sets
creates a listener for a
handler calls
my_ldr.load()
Drag a Loader component and a Button component from the Component panel to the
Library, then add the following code to the first frame of the timeline.
/**
Requires:
- Loader component in Library.
- Button component in Library.
*/
System.security.allowDomain("http://www.flash-mx.com");
//Create loader instance.
this.createClassObject(mx.controls.Loader, "my_ldr", 10);
this.createClassObject(mx.controls.Button, "load_button", 20, {label:"Load
image"});
my_ldr.move(0, 30);
my_ldr.autoLoad = false;
my_ldr.contentPath = "http://www.flash-mx.com/images/image1.jpg";
var loadListener:Object = new Object();
loadListener.click = function (evt_obj:Object) {
my_ldr.load();
load_button.enabled = false;
}
load_button.addEventListener("click", loadListener);
so that loading does not begin until a call to the
false
contentPath
event on the button. When the user clicks the button, the event
click
to load the image. The event handler also disables the button.
contentPath
contentPath
, and a Button instance and sets the
my_ldr
to the web location of an image and
property before
is used as is.
load()
Loader.load()
827

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents