FLASH动作问题

来源:百度知道 编辑:UC知道 时间:2024/06/28 11:54:56
function onEnterFrame()
{
++BouncerIndex;
if (BouncerIndex % 2 == 0)
{
this.attachMovie("Bouncer", "Bouncer" + BouncerIndex, BouncerIndex);
} // end if
if (BouncerIndex >= MaxBouncer)
{
BouncerIndex = 0;
} // end if
} // End of the function
MaxBouncer = 60;
BouncerIndex = 0;

上面这段代码, 是花瓣飘落, 可是他飘起来就不停勒, 怎么样才能让它播到那一桢就卜飘落勒.

改成
var a=true;
function onEnterFrame()
{
++BouncerIndex;
if (BouncerIndex % 2 == 0&&a)
{
this.attachMovie("Bouncer", "Bouncer" + BouncerIndex, BouncerIndex);
} // end if
if (BouncerIndex >= MaxBouncer)
{
BouncerIndex = 0;
} // end if
} // End of the function
MaxBouncer = 60;
BouncerIndex = 0;

然后在那一帧上写:a=false;
如果你要清除当前的花瓣还要写:
for(var i=0;i<60;i++)
{
_root["Bouncer"+i].removeMovie();
}