mardi 22 décembre 2015

Accessing animation of nested symbols using AS3 in Flash CS4

It's for my college project again.

I am making a Zombie shoot-em-up game. I created a Zombi symbol with the default Zombie sprite. Inside the symbol I placed three more sprites that are ZombiAttack, ZombiIdle, and ZombiMove, in the frames 1, 15 and 20 respectively. I further converted the sprites to symbols and inside their respective symbols I placed the remaining sprites. So it's like this:

Zombi (Main Symbol):

  1. ZombiAttack (in Frame 1):

    inside this I placed the remaining Zombie Attack sprites placed at intervals of 5 frames.

  2. ZombiIdle (in Frame 15):

    inside this I placed the remaining Zombie Idle sprites placed at intervals of 5 frames.

  3. ZombiMove (in Frame 20):

    inside this I placed the remaining Zombie Move sprites placed at intervals of 5 frames.

In the Zombi Class File I used the following code in the ENTER_FRAME listener's function:

this.gotoAndPlay(20); //For the moving animation of the Zombie.

This plays a static image of the frame 20 and not what's inside it (which I want it to play).

Now, my question is how do I do that? How do I play the nested symbols animation and control it further?

I've found a few posts that address a similar problem but the solution for them isn't working for me as many posts were dated back to 2004 and 2005.

Thanks in advance! :)

Aucun commentaire:

Enregistrer un commentaire