Skip to main content
Participant
April 15, 2013
Answered

Coding an animation

  • April 15, 2013
  • 1 reply
  • 267 views

So i just started working with flash and i have come across something i did not learn yet, i am required to make a simple sidescrolling game, i know how to make the character move using sprites but i do not know how i can code the animation for it, basically i have a simple animation made out of 8 frames, moving to the right, but i have no idea how to actually write the code for it so it will only move when i press the right arrow key, i looked at the code snippets and it says it must be converted to a movie clip, the frames are currently classed as graphics.

Waiting for any suggestions.

Thank you.

This topic has been closed for replies.
Correct answer kglad

assign your movieclip an instance name (eg, character_mc) and use:

character_mc.play();  // when your character moves and

character_mc.stop();  // when your character stops.

//

when you get a little more advanced, you'll use gotoAndStop() and gotoAndPlay() depending on what your character is doing and your particular character_mc frames.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 15, 2013

assign your movieclip an instance name (eg, character_mc) and use:

character_mc.play();  // when your character moves and

character_mc.stop();  // when your character stops.

//

when you get a little more advanced, you'll use gotoAndStop() and gotoAndPlay() depending on what your character is doing and your particular character_mc frames.