A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: if movie #1 is in level one, then load movie #2 to level one...

  1. #1
    Senior Member
    Join Date
    Nov 2000
    Posts
    208
    OKay, so i'm an actionscript newbie, and i am wondering what the code would look like for this kind of if statement.

    This is what i have now:
    A jukebox that loads external movie #1 to level 1 when you click play. The stop button unloads any movie in level 1. There is a next button and a previous button that currently have no actions assigned to them.

    What i want to happen:
    When the user clicks either next or previous, the appropriate movie # loads into level 1 to replace the one that was there before.

    So onRelease of next button, if movie #1 is in level 1, then load movie #2 into level 1. If movie #2 is in level 1, then load movie #3 into level 1, and if movie #3 is in level 1, then load movie #1 into level 1.

    Same for previous, except backwards. So onRelease of previous button, if movie #1 is in level 1, then load movie #3 into level 1.

    Can you help me write the code properly?
    Thanks!



  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    whatever was in _level1 will be replaced by the new clip loaded in the same _level... so you don't need any if statement.. only the loadMovieNum()
    gparis

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Posts
    208
    Yes i know that, but it depends on which movie is being played at the time the button is clicked. Like i said, if then NEXT button is clicked when movie #2 is loaded in level 1, then movie #3 should loaded, however if movie #1 is playing when NEXT is clicked, then movie #2 needs to load.

    So what should the code look like?

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    ok then 3 movies = 4 frames. The next button sends the clip to next frame the previous to previous frame (easy enough) on each frame is your command to load the clip. that clip is just a 4 frames actions movie. frame1 unloads and stopsAllSounds() frame1 loads music1, frame2 loads music2, frame3 loads music3.
    gparis

  5. #5
    Senior Member
    Join Date
    Nov 2000
    Posts
    208
    Oh!!! That makes soooo much sense! Thank goodness there are people like you with such logical minds! I didn't even think of that.

    Thanks a lot!

  6. #6
    Senior Member
    Join Date
    Nov 2000
    Posts
    208
    Okay, so i tried it, but i'm doing something wrong... there's no sound coming out. My little song display works... so when i hit next/prev, it is going to the right frame, but there is no sound. I put a stop action on each frame. Should i take that action off?

    Any ideas what else could be making the sound not work?

    Thanks again,

  7. #7
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    don't know.. Are you sure the movie goes to the next/previous frame (as it's blank, maybe write a # on each frame to see whether it goes there or not)
    gparis

  8. #8
    Senior Member
    Join Date
    Nov 2000
    Posts
    208
    Oh it's definately going to the proper frames because i have an indicator: that song name display that i was telling you about. I was all tickled that it worked, then i noticed no sound. And i made sure the volume was up and all that other stuff.

    So it's not the 'stop' action on each frame?

  9. #9
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    nope. it's got to stop. You've got the loadMovieNum() code right? other solution if the fla is not tooooo big send it over :gparis@securenet.net
    gparis

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