/***********/
/**************/
主要改变影片剪辑的x、y和rotation这三个属性。
void
{
image_mc.x = posX + (Math.floor(Math.random() * 4));
image_mc.y = posY + (Math.floor(Math.random() * 4));
image_mc.rotation = Math.random() * 4;
}
{
image_mc.x = posX + (Math.floor(Math.random() * 4));
image_mc.y = posY + (Math.floor(Math.random() * 4));
image_mc.rotation = Math.random() * 4;
}
第二个效果,使用的是TweenMax的插件。
因为使用的是最新的TweenMax,所有这里的as文件是被修改过的。
for each (var prop:String in props)
{
currentValueAdditions[prop] = (strengths[prop]*amplitude*decrease);
_target[prop] = _target[prop] - lastValueAdditions[prop] + currentValueAdditions[prop];
lastValueAdditions[prop] = currentValueAdditions[prop];
}
}
}
}
添加了一个属性“shake”,其中“numShakes”为在指定的时间内需要震动的次数。
if (tween)
{
tween.kill();
tween = null;
}
image_mc.x = posX;
image_mc.y = posY;
image_mc.rotation = 0;
}
参考链接: