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.

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<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 />

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

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

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

of 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 />

The following example creates a new movie clip, then creates child inside of it <strong>and</strong> loads a<br />

PNG image into the child. This allows the parent to retain any instance values that were<br />

assigned prior to the call to loadMovie.<br />

var mc:MovieClip = this.createEmptyMovieClip("mc",<br />

this.getNextHighestDepth());<br />

mc.onRelease = function():Void {<br />

trace(this.image._url); // http://www.w3.org/Icons/w3c_main.png<br />

}<br />

var image:MovieClip = mc.createEmptyMovieClip("image",<br />

mc.getNextHighestDepth());<br />

image.loadMovie("http://www.w3.org/Icons/w3c_main.png");<br />

See also<br />

_lockroot (MovieClip._lockroot property), unloadMovie (MovieClip.unloadMovie<br />

method), loadVariables (MovieClip.loadVariables method), loadMovie<br />

(MovieClip.loadMovie method), onPress (MovieClip.onPress h<strong>and</strong>ler),<br />

MovieClipLoader, onClipEvent h<strong>and</strong>ler, Constants, loadMovieNum function,<br />

unloadMovie function, unloadMovieNum function<br />

loadVariables (MovieClip.loadVariables method)<br />

public loadVariables(url:String, [method:String]) : Void<br />

Reads data from an external file <strong>and</strong> sets the values for variables in the movie clip. The<br />

external file can be a text file that ColdFusion generates, a CGI script, an Active Server Page<br />

(ASP), a PHP script, or any other properly formatted text file. The file can contain any<br />

number of variables.<br />

442 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!