Hey guys I am new to FlashPunk and to ActionScript 3 my situation is have 2 animation with in the same sprite sheet anim1 = from 0 to 74 anim2 = from 75 to 95
my question is: Is there an event listener for the animation to compete then on the next mouse press to start over always showing the animation from start to end.
code:
[Embed(source = ‘Assets/sheet_8x12.png’)] private const DUCK_2:Class;
public var _duck:Spritemap = new Spritemap(DUCK_2, 125, 225)
public function DuckEntity ()
{
_duck.add("idle", [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73], 30, true);
_duck.add("hit",[74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94], 30, false);
graphic = _duck;
_duck.play("idle");
}
override public function update():void
{
if(Input.mousePressed){
_duck.play("hit");
}
if(Input.mouseReleased){
_duck.play("idle")
}
}