animation question

Hi guys,

I need to accomplish the following,

– some code runs
– I wan to play an animation (a collection of png images)
– once the animation is complete I want to keep running the rest of the code

thanks

Vik [import]uid: 67619 topic_id: 14615 reply_id: 314615[/import]

You’d use a sprite sheet for your animation, I’m guessing;
http://developer.anscamobile.com/reference/index/sprite

Then you’d use a timer or an onComplete when you were done with it to move on with whatever code you liked. [import]uid: 52491 topic_id: 14615 reply_id: 54042[/import]

hey Peach,

I am using movieclip to do my animation… I was just wondering if it was possible to have an onComplete on an animation? ie… it plays the animation once then calls the onComplete code…

your statement ‘Then you’d use a timer or an onComplete when you were done with it to move on with whatever code you liked’

what onComplete are you referring to? [import]uid: 67619 topic_id: 14615 reply_id: 54050[/import]

Well it really depends on how you’re doing things, if you are using a transition (which I figure you might be using to spruce up the sprite) then you’d use onComplete.

If it’s just a stock standard sprite, work out how long it runs for based on the number of frames and the framerate and set a simple timer.performWithDelay() to start the rest of your code running.

Make sense? :slight_smile: [import]uid: 52491 topic_id: 14615 reply_id: 54156[/import]