[Flash MX] loaded movie controlling the source movie

hello there,

say i have a main movie, into this movie is loaded another movie on level_1.

is there any actionscript that allows a button inside the loaded movie control the main movie? i.o.w. can a button inside the loaded movie tell the main movie to go to another scene?

  • i am looking for code for that same button to unload the movie it is in itself… possible?

thanks very much in dvance

meisje

is there any actionscript that allows a button inside the loaded movie control the main movie?

_level0.gotoAndPlay("sceneName", frameNumber);

i am looking for code for that same button to unload the movie it is in itself… possible?

_root.unloadMovie();

?? =)

alas it was no go :frowning:

i typed:

on (release) {
_level0.gotoAndPlay(“Scene 2”, 1);
_root.unloadMovie();
}

i also tried with _parent in front of the root-path but that didn’t work either…

instead of the scene name and frame number, try with a frame label. go to Scene 2, highlight the first frame, and you’ll see an input field in the properties panel.

the script would change to:

_level0.gotoAndPlay("frameLabel");

as for unloading the swf…
there’s nothing wrong with the script, if you can’t get it to work… attach your files and i’ll check it out. :wink:

hey there, i am happy now, after stripping my project to make a lighter upload and testing it… it suddenly worked, hurray =) many thanks kax!

btw, is it possible to make the mainmovie level_1 right after start-up and load other movies into level_0? would be handier for me lay-out wise

wait wait,

i also found the reason why it didn’t work before stripping my project, i think it was because the button in question was from the library of the mainmovie, only when i converted that button to an internal button (of the loaded movie itself) the code worked…

so my question is, do you know a solution for this?

tia, meisje

here are 2 flashfiles with the external button that keeps the movie from unloading, if you could look at it please?

tia, meisje

:toad:

ok… first off, sorry about the delay. =)

anyway, i might be wrong, but i guess it didn’t worked because once the Button is imported to the movie, the on handler is erased. to solve the problem, give an instance name to the Button and paste this script in the timeline:

instanceName.onRelease = function() {
	_level0.gotoAndPlay("start");
	_root.unloadMovie(); 
};

and don’t forget to replace instanceName with the actual instance name of the Button. =)

all works now! hurray!

late reply… you have got to be kidding :slight_smile:

thanks for the excellent help

these smilees are all for you

<:} C:-) :toad:

later, meisje

no problem, meisje. =)

and welcome to kirupa forum!! :wink:

hurray! :slight_smile: