Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Coding an animation

New Here ,
Apr 15, 2013 Apr 15, 2013

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.

TOPICS
ActionScript
249
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 15, 2013 Apr 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.

Translate
Community Expert ,
Apr 15, 2013 Apr 15, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines