Graphics Reference
In-Depth Information
_targetFrame = targetFrame;
_loopCount = loopCount;
_revTimer.delay = speed;
_revTimer.addEventListener(TimerEvent.TIMER,
reverseFrame, false, 0, true);
}
_revTimer.start();
}
private static function
reverseFrame(e:TimerEvent):void {
if(_targetClip.currentFrame > _targetFrame){
_targetClip.prevFrame();
}else{
_targetClip.gotoAndStop(_targetFrame);
_revTimer.reset();
_loopCount==
1 ? _targetClip.play() :
replay();
}
}
private static function replay():void {
if (_currentLoop < _loopCount) {
_currentLoop++;
_targetClip.play();
}else{
_revTimer.removeEventListener(TimerEvent.TIMER,reverseFrame
);
_targetClip.dispatchEvent(new
DataEvent(REVERSE_COMPLETE,true));
_targetClip = null;
}
}
}
}
ReverseClip Breakdown
Once again, a quick look at the package and imports and then we
'
ll
move on:
package com.flashadbook.utils{
import flash.display.MovieClip;
import flash.events.DataEvent;
import flash.utils.setTimeout;
import flash.events.TimerEvent;
import flash.utils.Timer;
textending
anything in this classaswehaveinthepreviousclassesinthis
In the class declaration, you
'
ll notice that we aren
'
Search WWH ::




Custom Search