我已经分析了一个项目的所有代码,在它的一个类中有一个函数内增加的属性(变量),它实际上是一个动画步骤,并且播放mc的下一个帧的唯一方法是用的gotoAndPlay,gotoAndStop,prevFrame和nextFrame,但在课堂上它只是这个..神秘的变量
public function hurt(_damage:Number):void
{
animationStep:int;
//trace("hurt", health, _damage)
health-=_damage
if(health <= 0)
{
kill=true
health=0
}
animationStep=5 - health
trace(animationStep);
}
是什么让闪存知道animationStep是一个动画MV,如果它只是一个整数变种的一种方式?
看起来,改变该变量会使运行时间增加(步长)变慢。我看到的唯一奇怪的事情是animationStep每次运行时都会重置。 – durbnpoisn
我知道动画动画片段的唯一途径是使用gotoAndPlay,ect –
这很好,但在开始时将变量设置为全局变量。框架处理程序之外。 – durbnpoisn