0

我有一个带有实例名称宇宙飞船的影片剪辑。单击此影片剪辑时,我想更改过渡速度。这是我的代码:

import fl.transitions.*;
import fl.transitions.easing.*; 

var myspaceship:TransitionManager = new TransitionManager(spaceship);
myspaceship.startTransition({type:Fly, direction:Transition.OUT, duration:18,startPoint:6});
spaceship.addEventListener(MouseEvent.CLICK, speedfast);
function speedfast (evt:MouseEvent):void
{
// reset frame count to 0
//here i want the duration to become say 12 or something
}

那就是我希望飞船在鼠标点击时加速......

4

1 回答 1

0

更新

var myspaceship:TransitionManager = new TransitionManager(spaceship);
var speed:int = 18;

myspaceship.startTransition(
    {type:Fly, direction:Transition.OUT, duration: speed,startPoint:6}
);

spaceship.addEventListener(MouseEvent.CLICK, speedfast);
function speedfast (evt:MouseEvent):void {
   // reset frame count to 0
   trace("Increase Speed");
   speed -= 6;
   trace("Duration of transition: " + speed);
   //Start transition
   trace("Start transition");
   myspaceship.startTransition(
    {type:Fly, direction:Transition.OUT, duration: speed,startPoint:6}
   );
   //or speed = 12;
   //or better speed = speed / 2;
}
于 2013-11-05T09:09:18.350 回答