My goal: I am trying to create a holiday eCard. I would like to click on the buttons (lights, snow, and song) and have them play on a loop until the reset button is clicked. At which point, everything would go back to frame one where the action is to stop(). What is the best way to go about achieving this? What I am currently doing sort of works but I can't achieve my desired results. When I test the movie, I can click on the lights icon and the lights blink on the xmas tree and don't stop, but when I click on the music, they stop. The reset button works for the music but not the lights. I haven't created the snow yet because I am still trying to figure out how to make the snowfall in a loop. I'm sure I'm doing a lot wrong but I am a beginner.
Please see the attached images for the timeline, stage, and code being used. I need this turned in by tonight and can't figure it out, so quick replies are appreciated 🙂
each animated object (lights, snow, song) should be a movieclip. if this is canvas/html5, you could then use:
this.objects = [this.lights, this.snow, this.song, etc];
Thank you for your reply! I'm using an ActionScript 3.0 document, so the code you provided won't work, right? If not, is there a code I could use that is compatible with my document?
I apologize for attaching the documents. I didn't realize you could do that in the post. I have embedded them for your review. Hopefully, they will help explain my issue/goal a little better.
your approach (putting all the animations on the main timeline) is going to be an impossible mess unless you account for all combinations of animations, and then it would no longer be impossible, but it will still be a mess. ie, you'll need 2**n sections of main timeline to display all possible combination of animation with n objects.
so again, use movieclips and put each movieclip's animation on its own timeline. then use as3 to control:
var objects:Array = [this.lights, this.snow, this.song, etc];