# Animation switching in AS3

**URL:** <https://forum.kirupa.com/t/animation-switching-in-as3/328249>\
**Category:** flash\
**Created:** [April 30, 2012, 6:20pm UTC](https://forum.kirupa.com/t/animation-switching-in-as3/328249 "2012-04-30T18:20:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 30, 2012, 6:20pm UTC](https://forum.kirupa.com/t/animation-switching-in-as3/328249/1 "2012-04-30T18:20:31Z")

</div>

Hello,

I’m writing a simple game program where enemies scroll down the screen and the player must hit them to score points.

The problem is switching from one animation to another. I have 3 animations a running, an idle an an attack animation, what i want to do is have my attack animation play through once and then return to idle but all i manage to do is a continual loop of attack. Ive tried a few things to fix this but i havent gotten anywhere with it.

Does anyone know how to do what i’m trying?
