View comments | RSS feed

loadMovieNum()

Availability

Flash Player 4. Flash 4 files opened in Flash 5 or later are converted to use the correct syntax.

Usage

loadMovieNum(url:String,level:Number [, variables:String]) : Void

Parameters

url The absolute or relative URL of the SWF or JPEG file to be loaded. A relative path must be relative to the SWF file at level 0. For use in the stand-alone Flash Player or for testing in test mode in the Flash authoring application, all SWF files must be stored in the same folder and the filenames cannot include folder or disk drive specifications.

level An integer specifying the level in Flash Player into which the SWF file will load.

variables An optional parameter specifying an HTTP method for sending variables. The parameter must be the string GET or POST. If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.

Returns

Nothing.

Description

Function; loads a SWF or JPEG file into a level in Flash Player while the originally loaded SWF file plays.

Tip: If you want to monitor the progress of the download, use MovieClipLoader.loadClip() instead of this function.

Normally, Flash Player displays a single SWF file and then closes. The loadMovieNum() action lets you display several SWF files at once and switch among SWF files without loading another HTML document.

If you want to specify a target instead of a level, use loadMovie() instead of loadMovieNum().

Flash Player has a stacking order of levels starting with level 0. These levels are like layers of acetate; they are transparent except for the objects on each level. When you use loadMovieNum(), you must specify a level in Flash Player into which the SWF file will load. When a SWF file is loaded into a level, you can use the syntax, _levelN, where N is the level number, to target the SWF file.

When you load a SWF file, you can specify any level number and you can load SWF files into a level that already has a SWF file loaded into it. If you do, the new SWF file will replace the existing SWF file. If you load a SWF file into level 0, every level in Flash Player is unloaded, and level 0 is replaced with the new file. The SWF file in level 0 sets the frame rate, background color, and frame size for all other loaded SWF files.

The loadMovieNum() action also lets you load JPEG files into a SWF file while it plays. For images and SWF files, the upper left corner of the image aligns with the upper left corner of the Stage when the file loads. Also in both cases, the loaded file inherits rotation and scaling, and the original content is overwritten in the specified level.

Use unloadMovieNum() to remove SWF files or images that were loaded with loadMovieNum().

Example

The following example loads the JPEG image tim.jpg into level 2 of Flash Player:

loadMovieNum("http://www.macromedia.com/devnet/coldfusion/articles/basic_chart/tim.jpg", 2); 

See also

loadMovie(), unloadMovieNum(), _level

Comments


chuckjr said on Sep 8, 2004 at 8:01 AM :
Is it true that loadMovieNum streams the new movie versus loadMovie
which downloads the whole movie before it can play?
No screen name said on Sep 20, 2004 at 6:19 AM :
Can't you just add to this help that the jpg's could NOT BE progressive!?!? It would be much easier for all of us if you write about such 'unimportant' things...
castanza said on Sep 21, 2004 at 11:08 PM :
It would be nice to talk about how to talk to a movie that has been loaded via loadmovie or loadmovienum. How annoying that I've wasted HOURS trying to figure out how to just set variables in a movie that I've loaded via this method. And why the LocalConnection feature wouldn't support this is beyond me either. Hello????
Francis Cheng said on Oct 15, 2004 at 10:24 AM :
Thanks for the suggestion. I've added a note about avoiding progressive JPEG files to this entry and other related entries. As for chuckjr's question, the answer is no, neither LoadMovie nor LoadMovieNum streams movies.
Francis Cheng said on Jan 18, 2005 at 3:29 PM :
The following technote was just published today regarding loadMovieNum():

TITLE: Using loadMovieNum method to load a Flash Player movie containing a media component fails.

ISSUE: Using the loadMovieNum() method to load a child Macromedia Flash Player movie (SWF) that contains a media component at Level 1 causes a "Script is running too slow" warning message. The media component fails to function correctly.

SOLUTION: This is known limitation of the media components. Instead of using the loadMovieNum() method, use the loadMovie() method and target a MovieClip to load into instead of a level.

LINK: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=ca66837e

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001405.html