0

これは私がこれまでに得たものです:

stop();

stage.addEventListener(MouseEvent.MOUSE_OVER, playMovie); function playMovie(event) { play(); }
stage.addEventListener(MouseEvent.MOUSE_OUT, stopMovie); function stopMovie(event) { gotoAndStop(0);}


stop();

そして、「gotoAndStop」の代わりに、現在のフレームとは逆の種類の関数を探しています

ありがとう

マックス

4

1 に答える 1

1

あなたがそれを行うことができる1つの方法:

//a function you can call and pass in the item/timeline you want played backwards
function goBackwards(item:MovieClip):void {
    item.stop(); //make sure the item isn't playing before starting frame handler below
    item.addEventListener(Event.ENTER_FRAME, moveBackwards); //add a frame handler that will run the moveBackwards function once every frame
}

//this function will move something one frame back everytime it's called
function moveBackwards(e:Event):void {
    var m:MovieClip = e.currentTarget as MovieClip; //get the movie clip that fired the event
    if(m.currentFrame > 1){ //check to see if it's already back to the start
        m.prevFrame();  //if not move it one frame back
    }else{
        m.removeEventListener(Event.ENTER_FRAME,moveBackwards); //if it is (at the start), remove the enter frame listener so this function doesn't run anymore
    }
}

したがって、逆方向に再生したいオブジェクトが という名前bobの場合、次のようにします goBackwards(bob);。逆再生したいタイムライン内で使いたい場合はgoBackwards(this);.

于 2012-11-30T21:29:41.523 に答える