Interaction Between Loaded Movies

i have my loaded .swf buttons loading ‘movie1’ and ‘movie2’. both ‘movie1’ and ‘movie2’ have a tween in frames 1-5, which is a box that slides open and is stopped. in frames 6-10 the box slides backwards in the opposite and dissapears.

i would like it if ‘movie1’ is open and the user clicks the button for ‘movie2’, ‘movie1’ plays 6-10 and then loades ‘movie2’ and vice versa. i just don’t a script for this function…can someone help me? i attached the files to this post.


I haven’t looked at your file, but I just wanted to give you some advice: you can always store values in _root, which will make that value accesible to both the loaded and the main file. That way, you can interact with your loaded movies. You can also target the main timeline of your loaded movie from the main movie by targetting the movieclip it was loaded in :slight_smile:

would the script look something like this:

on (release) {
        if (_root.movie2.line_mc._currentframe == 5) {
                tellTarget (_root.movie2.line2_mc.) {
        } else {
                loadMovieNum("movie1.swf", 1);

this script applies if ‘movie2’ is open and the user clicks the button for ‘movie1’, ‘movie2’ plays 6-10 and then loades ‘movie1’ and vice versa if the other button is chosen.

i tried this and it didn’t work for me…any suggestions?

You can try this:

_root.curmovie = "movie1";
movie2button.onRelease = function(){
if(_root.curmovie != "movie2" && _root.movieholder.line_mc._currentframe == 5){

And then, at the last frame of movie1, you place these actions:



i am going to try it now! what exactly is curmovie?
i’ve never heard of it…but i haven’t heard of a lot of things in Flash ( i’m sure )


i tried everything you did and said, but now, the buttons don’t load the movies at all.

i attached the revised version. could it be something else?


curmovie is just a variable I’m placing in _root. It doesn’t load because you don’t have a movieclip to load it to. You’re not supposed to just copy/paste code from here and hope it’ll work, you need to look what happens and change your movie structure for the actionscript to work :slight_smile:

Also, there is no outro animation, just two frames. You said there were 10 in them ? You’re checking if _currentframe is 5, but there are only 2 frames !

i never just copied and pasted the script into my project without adjusting things, but in the 2nd frame of movie1 and movie2 lies a movieclip that is 10frames long. again, thanks for your help. it is truly appreciated. unfortunately i am away from my computer, so i won’t be able to look at what you have done until monday.