I am currently a programming student and am attempting to learn some Flash/Action Script in my spare time for fun. I have been familierizing myself with the language and it's application using Flash. I have started to make a simple game to implement what I have learned so far and have run into a snag.
What I am doing is instantiating a fist image, increasing its height and width to simulate it coming towards the screen as a punch(yes I know lame but it's a start ). After the punch is thrown I wanted to remove the fist from the stage. My problem is that the remove tween code is ran instantly and the animation does not have time to play. This is the code I am using :
import fl.transitions.Tween; import fl.transitions.easing.*; var fist = new Fist; fist.x = 50; fist.y = 50; addChild(fist); var fistTween:Tween = new Tween(fist,"width",None.easeNone,50,100,2,true); var fistTween2:Tween=new Tween(fist,"height",None.easeNone,50,100,2,true); removeChild(fist);
I would of course wrap most of that up in a punch method. Could anyone advise me on how I could make the line to remove the child not run until after the animation completes? Any info would be appreciated, thanks much!