MovieClip
891
Example
The following example creates a new movie clip, and then creates child inside of it and loads a
PNG image into the child. This lets the parent retain any instance values that were assigned
prior to the call to
loadMovie
.
var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc.onRelease = function():Void {
trace(this.image._url); // http://www.w3.org/Icons/w3c_main.png
}
var image:MovieClip = mc.createEmptyMovieClip("image",
mc.getNextHighestDepth());
image.loadMovie("http://www.w3.org/Icons/w3c_main.png");
The
MovieClip.getNextHighestDepth()
method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth()
method.
See also
_lockroot (MovieClip._lockroot property)
,
unloadMovie (MovieClip.unloadMovie
method)
,
loadVariables (MovieClip.loadVariables method)
,
loadMovie
(MovieClip.loadMovie method)
,
onPress (MovieClip.onPress handler)
,
MovieClipLoader
,
onClipEvent handler
,
on handler
,
loadMovieNum function
,
unloadMovie function
,
unloadMovieNum function
loadVariables (MovieClip.loadVariables method)
public loadVariables(url:String, [method:String]) : Void
Reads data from an external file and sets the values for variables in the movie clip. The
external file can be a text file that Macromedia ColdFusion generates, a CGI script, an Active
Server Page (ASP), a PHP script, or any other properly formatted text file. The file can
contain any number of variables.
You can also use the
loadVariables()
method to update variables in the active movie clip
with new values.
The
loadVariables()
method requires that the text of the URL be in the standard MIME
format:
application/x-www-form-urlencoded
(CGI script format).
In SWF files running in a version earlier than Flash Player 7,
url
must be in the same
superdomain as the SWF file that is issuing this call. A superdomain is derived by removing
the left-most component of a file's URL. For example, a SWF file at www.someDomain.com
can load data from a source at store.someDomain.com because both files are in the same
superdomain of someDomain.com.
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...