dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: interaction between loaded movies

  1. #1
    Member
    Join Date
    May 2002
    Posts
    91

    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.

    thanks.
    Attached Files Attached Files
    j[squared]

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    This could be coded differently... But here's one way of doing it!
    You could get rid of the preloader display, once both external movies are cached after an initial download.
    Attached Files Attached Files

  3. #3
    Member
    Join Date
    May 2002
    Posts
    91
    i just don't understand one thing, where in this script does it tell the loadedMovie ( movie1.swf ) to play frames 6-10? how is it working without something that says this statement?

    code:

    on (release) {
    if (_level0.current_selection == 1) {
    stop();
    } else if (_level0.current_selection == 0) {
    loadMovieNum("movie1.swf", 1);
    _level0.current_selection = 1;
    } else {
    _level1.line2_mc.play();
    _level0.current_selection = 1;
    }
    }



    thanks.
    jonathan
    j[squared]

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Well since your movies when loaded are actually stopped at frame 6 (where you have a stop(); action), just issuing a play(): action will have them play frames 7 to 11, where they're then told to go to and stop on frame one...

    But you could of also used the following, if you understand it better...
    code:

    on (release) {
    if (_level0.current_selection == 1){
    stop();
    } else if (_level0.current_selection == 0){
    loadMovieNum("movie1.swf", 1);
    _level0.current_selection = 1;
    } else {
    _level1.line2_mc.gotoAndPlay(7);
    _level0.current_selection = 1;
    }
    }


  5. #5
    Member
    Join Date
    May 2002
    Posts
    91
    i gotcha...

    i noticed in the last frames of movie1 and movie2 you put the loadMovie action. what is the best thing to do when there are 5 buttons and there is no telling which button the user is going to choose next and the loadMovie action doesn't suffice anymore unless there is a way that script can read which button has been pressed.
    j[squared]

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You'd have to modify the scripts using another variable, holding the name of the movie to load, and probably standardize the name of the clip within each external movie.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center