//在flash中的as,記得要把playback.as放在相同資料夾的com/playback.as
import com.playback;
var _PlayBack:MovieClip = new playback();
//使用_PlayBack物件中的PlayBack套用在MC,MC是任何指定物件
_PlayBack.PlayBack(MC);
//--------playback.as--------//
package com
{
import flash.display.MovieClip;
import flash.events.Event;
/**
* ...
* toooooo2003@gamil.com ...
*/
public class playback extends MovieClip
{
var n:MovieClip;
public function PlayBack(N:MovieClip):void
{
this.addEventListener(Event.ENTER_FRAME, onEventEnterFrame);
n = N;
}
private function onEventEnterFrame(e:Event):void
{
if (n.currentFrame == 1) {
trace("playback_onEnterFrame_remove");
this.removeEventListener(Event.ENTER_FRAME, onEventEnterFrame);
}else {
n.prevFrame();
trace("playback_on");
}
}
}
}
//--------playback.as--------//
No comments:
Post a Comment