A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Playing selective scenes in a movie

  1. #1
    Junior Member
    Join Date
    Apr 2006
    Posts
    7

    Playing selective scenes in a movie

    Hi,

    I am sure this a simple question but so far it defeated me. I am trying to control the scenes which are played by the menu. So I want to be able to click on the menu and go to specific scene and play it in a loop but just that scene. Then return back to the menu and select the next scene and so on.


    Thank you for your help

    Malgosia

  2. #2
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,929
    One way (without using attachMovie or loadMovie) would be to set up your "scene" (although I wouldn't recommend actually using Scenes to separate your content) so that at the end of the animation, add a goToAndPlay(first frame label of your animation), so that it loops, and then just have your menu do a goToAndPlay(first frame of whichever "scene" they're going to).

    Hope that makes sense and answers your question!!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  3. #3
    Senior Member zoranvedek's Avatar
    Join Date
    Aug 2001
    Location
    Wagoner OK
    Posts
    893
    Like he said, but it's better to put your goto/play in another scene after your main scene...............

    ....like follows:

    scene1-shows all elements in the main movie
    scene2-stops movie
    scene3-hides elements shown in scene1, goto scene4
    scene4-shows elements for loop scene, goto scene5
    scene5-does all the actions for the loop
    scene6-goto scene5 and play(this will loop scene5)

    You can have a button that once clicked(buttonup or buttondown choice is yours) will goto scene3 and the rest happens automatically. to go further with it, once your done with the looping go back to scene1 which will satrt all over. To add more actions add scene7(scene8, scene9, etc) and set it up like the original configuration.

    If you need to count a loop, get a property from one of the elements(is showing, opacity, location, collision, whatever) and then figure out how many times it does that property for the loop, add some actions to count that, and then when it reaches that point goto scene1(you might also want to reset that variable in scene1 so that the loop will restart<----otherwise your variable has already reached the point of going to scene1 and will skip right back to there).

    Hope this isn't too confusing, but that's as simple as I can word it right now. Try it a few times and you'll get used to working like that.


    A better idea might be to use child movies, but thats a whole other subject, and variables are iffy between parent and child(at least that's been my experience).

    -Jason

  4. #4
    Senior Member zoranvedek's Avatar
    Join Date
    Aug 2001
    Location
    Wagoner OK
    Posts
    893
    A simple way to count the loop would be just to set a variable to +1 each time it hits the goto scene for the loop.....

    ...Sorry that just hit me.


    -Jason

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