Name

loadMovie( ) Global Function — load an external . swf file into the Player

Availability

Flash 4 and later. The loadMovie( ) function in Flash 5 corresponds to the Flash 4 Load Movie with a target path.

Synopsis

loadMovie(URL, target)
loadMovie(URL, target, method)

Arguments

URL

A string specifying the absolute or relative file path to the external .swf file to load. All URLs must use forward slashes, and absolute URLs must include either the http:// or file|/// protocol reference.

target

A string indicating the movie clip or document level that will host the external .swf file. May also be a reference to an existing movie clip or document level (references are converted to paths when used in a string context).

method

An optional string indicating the method by which to send variables to an external script. The legal values for method are "GET" and "POST". This parameter must be a literal, not a variable or other expression. The standalone version of the Flash Player always uses the "GET" method regardless of the method specified.

Description

The loadMovie( ) function imports the .swf file located at URL into the Flash Player.

If target is a reference to an existing movie clip or a string indicating the path to a movie clip, the loaded .swf file is placed into the specified clip (causing the eviction of any previous content). To load a movie into the current movie clip, use the empty string as the target parameter, as in:

loadMovie("myMovie.swf", "")

If target is a reference to an existing ...

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.