0
votes

summary--I have a saucer movieclip that has 2 sprite sequences on its timeline: 1) looping running lights (ff-10) and 2) destruction animation(ff11-20). I want the running lights to loop until a hit event, then I want the destruction animation. I would like to keep all my commands in the saucer or document class. Currently I can only make this work by putting a "gotoAndPlay(1)" in the saucer timeline at f10. I'm new but I think this an as2 style.

I imagine this could also work by assigning an enterframe event listener to the saucer and loop when current frame==10. That seems expensive, esp if there are multiple saucers.

Any comment or advice on this scenario greatly appreciated. thanks

1

1 Answers

0
votes

I don't think that you must add an ENTER_FRAME event listener for looping when you can already do it by a single line of code you have mentioned.

I think that given the scenario you described (having both the animations in a single timeline), the approach you are taking is good enough.

Of course there are multiple ways of doing the same thing. may be you could do all the animation from code or you could split the animations across symbols and add and remove relevant symbols when a hit event has happened.

If you are really worried about putting even a single line of code in timeline, my suggestion is "don't be a purist". Your suggestion of gotoandplay(1) is much easier for me to understand than if you have posted the ENTER_FRAME event handler.