import fl.motion.Animator;
import fl.motion.MotionEvent
var this_xml:XML = <Motion duration="30" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
<source>
<Source frameRate="30" x="240.4" y="201.35" scaleX="0.39" scaleY="0.39" rotation="0" elementType="movie clip" symbolName="mcMonster">
<dimensions>
<geom:Rectangle left="0" top="0" width="109.2" height="125.4"/>
</dimensions>
<transformationPoint>
<geom:Point x="0.5" y="0.5"/>
</transformationPoint>
</Source>
</source>
<Keyframe index="0" tweenSnap="true" tweenSync="true">
<tweens>
<SimpleEase ease="0"/>
</tweens>
</Keyframe>
<Keyframe index="29" scaleX="2.564102564102564" scaleY="2.564102564102564"/>
</Motion>;
var this_animator:Animator = new Animator(this_xml, this);
this_animator.play();
this_animator.addEventListener(MotionEvent.MOTION_ END, hurtPlayer);
function hurtPlayer(event:MotionEvent):void
{
this.parent.removeChild(this);
}
this.addEventListener(MouseEvent.CLICK, killMonster);
function killMonster (event:MouseEvent):void
{
this_xml = <Motion duration="5" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
<source>
<Source frameRate="30" x="217.2" y="143.8" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="Monster" class="Monster">
<dimensions>
<geom:Rectangle left="-55" top="-64" width="109.2" height="125.4"/>
</dimensions>
<transformationPoint>
<geom:Point x="0.5004578754578755" y="0.5003987240829346"/>
</transformationPoint>
</Source>
</source>
<Keyframe index="0" rotateDirection="cw" rotateTimes="1" tweenSnap="true" tweenSync="true">
<tweens>
<SimpleEase ease="0.2"/>
</tweens>
</Keyframe>
<Keyframe index="4" scaleX="0.574" scaleY="0.574">
<color>
<Color alphaMultiplier="0.08"/>
</color>
</Keyframe>
</Motion>;
this_animator = new Animator(this_xml, this);
this_animator.play();
this_animator.addEventListener(MotionEvent.MOTION_ END, die);
}
function die (event:MotionEvent):void
{
this_animator.removeEventListener(MotionEvent.MOTI ON_END, hurtPlayer)
this.parent.removeChild(this);
}