# Animating MC's in a Game

**URL:** https://forum.kirupa.com/t/animating-mcs-in-a-game/294984
**Category:** flash
**Created:** [August 23, 2009, 11:29pm UTC](https://forum.kirupa.com/t/animating-mcs-in-a-game/294984 "2009-08-23T23:29:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Nick23](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@Nick23](https://forum.kirupa.com/u/Nick23)
#### Post date: [August 23, 2009, 11:29pm UTC](https://forum.kirupa.com/t/animating-mcs-in-a-game/294984/1 "2009-08-23T23:29:49Z")

</div>

Hello All,  
I am working on animations for my game. I am having trouble understanding how to control what animations to play using AS3 (such as running, idle, etc.)

I have an MC called player and inside player I have a lot of motion tweens that make up all the animations… for example frames 1-20 is an idle animation, frames 21-40 is running, etc.

How do I play these sequences in AS3…  
Would it be something like…?

```auto
running = true; frame=41; if (running){if (frame>40) player.gotoAndPlay(21); frame+=1;}

```

Thanks!
