PDA

View Full Version : loadMovie in MX


keith_walesjr
04-03-2003, 08:49 PM
I shouldn't have trouble with something this simple, but....

I have a three layer movie to act as a viewer for external .swf files. i have a button to load the first of four movies. I set the button's ActionScript with the following code:

on (press) {
MovieClip.loadMovie(SurvMgr_1.swf,2);
}

The SurvMgr_1.swf file resides in the same directory as the viewer file. The ,2 is to try and get the movie into the second layer.

When I export and click the button nothing happens. Am I putting the script in the wrong place? or Is it a syntax or directory thing.

Any suggestions would be appreciated.

vosgien
04-04-2003, 01:26 PM
Hi,
Two things, first the 2 is a _level and not a layer, secondly your code should look like this:

on (press) {
MovieClip.loadMovie("SurvMgr_1.swf",2);
}


Cheers

Vosgien

mpol777
04-04-2003, 06:52 PM
if you are loading a move into a target you do not need to specify the level or target in the loadMovie method.

ie:
targetMovieClip.loadMovie("loadMe.swf");

vosgien
04-04-2003, 09:03 PM
Hi,
Agreed !
The problem with keith_walesjr code was purely syntax, the " " was missing form the code, and he had assumed that ,2 meant layer when it actually refers to _level

Cheers

Vosgien