03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

When a SWF file is loaded into a target movie clip, you can use the target path of that movie<br />

clip to target the loaded SWF file. A SWF file or image loaded into a target inherits the<br />

position, rotation, <strong>and</strong> scale properties of the targeted movie clip. The upper left corner of the<br />

loaded image or SWF file aligns with the registration point of the targeted movie clip.<br />

Alternatively, if the target is the root Timeline, the upper left corner of the image or SWF file<br />

aligns with the upper left corner of the Stage.<br />

Use unloadMovie() to remove SWF files that were loaded with loadMovie().<br />

Parameters<br />

url:String - The absolute or relative URL of the SWF or JPEG file to be loaded. A relative<br />

path must be relative to the SWF file at level 0. Absolute URLs must include the protocol<br />

reference, such as http:// or file:///.<br />

target:Object - A reference to a movie clip object or a string representing the path to a<br />

target movie clip. The target movie clip is replaced by the loaded SWF file or image.<br />

method:String [optional] - Specifies an HTTP method for sending variables. The parameter<br />

must be the string GET or POST . If there are no variables to be sent, omit this parameter. The<br />

GET method appends the variables to the end of the URL <strong>and</strong> is used for small numbers of<br />

variables. The POST method sends the variables in a separate HTTP header <strong>and</strong> is used for<br />

long strings of variables.<br />

Example<br />

Usage 1: The following example loads the SWF file circle.swf from the same directory <strong>and</strong><br />

replaces a movie clip called mySquare that already exists on the Stage:<br />

loadMovie("circle.swf", mySquare);<br />

// equivalent statement (Usage 1): loadMovie("circle.swf",<br />

_level0.mySquare);<br />

// equivalent statement (Usage 2): loadMovie("circle.swf", "mySquare");<br />

The following example loads the SWF file circle.swf from the same directory, but replaces the<br />

main movie clip instead of the mySquare movie clip:<br />

loadMovie("circle.swf", this);<br />

// Note that using "this" as a string for the target parameter will not work<br />

// equivalent statement (Usage 2): loadMovie("circle.swf", "_level0");<br />

The following loadMovie() statement loads the SWF file sub.swf from the same directory<br />

into a new movie clip called logo_mc that's created using createEmptyMovieClip():<br />

this.createEmptyMovieClip("logo_mc", 999);<br />

loadMovie("sub.swf", logo_mc);<br />

Global Functions 55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!