Graphics Reference
In-Depth Information
public function SimpleGallerySample(){
_simpleGallery = new SimpleGallery(this,
_galleryPath, _imageArray, _columns, _thumbScale,
_padding);
_simpleGallery.setPosition(84,105);
addChild(_simpleGallery);
}
}
}
The ReverseClip Class
ReversingaMovieClipinFlashcancomeinhandyinmany
situations like animated menu buttons or really anything else that
may be moving on the stage. I
ve included the following small
ReverseClip class that I put together simply because I find myself
using it to get to previous states of animations in numerous projects.
It
'
'
s pretty small and straightforward, so the explanation on this one
is shorter, but let
'
s take a look at the entire piece of code first.
ReverseClip Code
package com.flashadbook.utils{
import flash.display.MovieClip;
import flash.events.DataEvent;
import flash.utils.setTimeout;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class ReverseClip{
public static const REVERSE_COMPLETE:String =
" reverseComplete " ;
private static var _revTimer:Timer = new Timer(0);
// the timer used to run the clip in reverse
private static var _targetClip:MovieClip; // the
MovieClip which will be reversed
private static var _targetFrame:int; // the frame
at which the reversal will be considered complete
private static var _loopCount:int; // the number of
times to repeat the reversal (0 is default,
1 loops
infinately)
private static var _currentLoop:int = 0; // the
loop that is currently playing
public static function play(targetClip:MovieClip,
loopCount:int=0, targetFrame:int=1, speed:Number=30):void {
if(!_revTimer.hasEventListener(TimerEvent.TIMER)){
_targetClip = targetClip;
Search WWH ::




Custom Search