Example of using animation events

This may be a simple question, but I am a newbie and I haven’t been able to find an answer.

I would like my sprite animation to play and then when it is finished trigger a function to do some text manipulation.

Something like (pseudo-code):

tap on animation –
animation plays –
When animation is finished –
set text items on screen –
Thanks in advance for your suggestions.
[import]uid: 54728 topic_id: 10257 reply_id: 310257[/import]

Check this page. especially the last part

http://developer.anscamobile.com/reference/sprite-sheets

si:addEventListener(“sprite”, listener)

Notify listener when the spriteInstance animation has an event.

The event, passed to the listener, has the following fields:

event.sprite The sprite that fired the event; its current properties may also be accessed via the event: e.g., event.sprite.sequence.

event.phase
The phase is one of:

“end” - the sprite stops playing

“loop” - the sprite loops (from last to first, or reverses direction)

“next” - the sprite’s next frame is played [import]uid: 48521 topic_id: 10257 reply_id: 37421[/import]