Load movie level

Hi
I have to load a movie in level 01. So how can I make the movie to be loaded in a x and y axis that I choose?

Using the LoadMovie function you can specify where to load the movie by replacing a blank movie with it.

Check the bold stuff

loadMovie

Availability

Flash Player 3.

Usage

loadMovie(“url”,level/target[, variables])

Parameters

url The absolute or relative URL of the SWF file or JPEG file to be loaded. A relative path must be relative to the SWF file at level 0. The URL must be in the same subdomain as the URL where the movie currently resides. For use in the 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.

target A path to a target movie clip. The target movie clip will be replaced by the loaded movie or image. You must specify either a target movie clip or a level of a target movie; you can’t specify both.

level An integer specifying the level in the Flash Player into which the movie will be loaded. When you load a movie or image into a level, the loadMovie action in the Actions panel in normal mode switches to loadMovieNum; in expert mode, you must specify loadMovieNum or choose it from the Actions toolbox.

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

Action; load a SWF or JPEG file into the Flash Player while the original movie is playing. The loadMovie action lets you display several movies at once and switch between movies without loading another HTML document. Without the loadMovie action, the Flash Player displays a single movie (SWF file) and then closes.

When you use the loadMovie action, you must specify either a level in the Flash Player or a ** target movie clip, into which the movie will load**. If you specify a level, the action changes to loadMovieNum. If a movie is loaded into a target movie clip, you can use the target path of that movie clip to target the loaded movie.

A movie or image loaded into a target inherits the position, rotation, and scale properties of the targeted movie clip. The upper left corner of the loaded image or movie aligns with the registration point of the targeted movie clip. Alternatively, if the target is the _root Timeline, the upper left corner of the image or movie aligns with the upper left corner of the Stage.

Use the unloadMovie action to remove movies loaded with the loadMovie action.

** Example **

The following loadMovie statement is attached to a navigation button labeled Products. There is an invisible movie clip on the Stage with the instance name dropZone. The loadMovie action uses this movie clip as the target parameter to load the products in the SWF file, into the correct position on the Stage.

on(release) {
loadMovie(“products.swf”,_root.dropZone);
}

The following example loads a JPEG image from the same directory as the SWF File that calls the loadMovie action:

loadMovie(“image45.jpeg”, “ourMovieClip”);

See also

loadMovieNum
unloadMovie
unloadMovieNum
_level

[AS]var depth = 1000, x = 40, y = 60;//choose depth and coordinates you want to load
_root.onEnterFrame = function() {
this["_level"+depth]._x = x;
this["_level"+depth]._y = y;
};
my_button.onPress = function() {
loadMovieNum(“yourmovie.swf”, depth);
};[/AS]

Claudio - What’s with the onEnterFrame ??

[AS]
var depth = 1000, x = 40, y = 60;//choose depth and coordinates you want to load
_root["_level"+depth]._x = x;
_root["_level"+depth]._y = y;
my_button.onPress = function() {
loadMovieNum(“yourmovie.swf”, depth);
};
[/AS]

Shouldn’t that work ?

are you sure your code works claudio??

try this

mybutton.onPress = function ()
{
var depth = 1000, x = 40, y = 60
loadMovieNum(“yourmovie.swf”, depth);
eval("_level"+depth)._x = x
eval("_level"+depth)._y = y
}

Yes my code do works… or at least used to.
:-\

But why did you use _root.onEnterFrame ? It’s enough to set the x and y once, isn’t it ?

No Voetsjoeba, if you use that sintax it wont work
_root["_level"+depth]._x = x;

ahmed, i tested and it worked

*Originally posted by claudio *
**No Voetsjoeba, if you use that sintax it wont work
_root[“_level”+depth]._x = x;

You cant say _root._level **

No ? I thought you could … you used this on root too, so that would make _root._level right ? :wink:

Actually i tried ahmed’s code and couldnt get it to work :-\

^ ?? :stuck_out_tongue:

*Originally posted by claudio *
**ahmed, i tested and it worked **

lol i meant i tried my code and it worked.
but no success with ahmed’s

A bit late, but…

_root["_level"+depth] should work too. :sigh:

Inside the onEnterframe handler or outside?

I don’t think that makes a difference. _root is _root, anywhere. Only make sure the depth var is there.

Nope… I just tested and it only works inside the onEnterFrame handler

It works without the onEnterFrame handler too!! :stuck_out_tongue:

If you have any problems, it’s probably because the level is not registered yet.