home *** CD-ROM | disk | FTP | other *** search
- class Thumbrack extends MovieClip
- {
- var arThumb;
- var origheight;
- var origwidth;
- var depth;
- var ctrTween;
- var cpos;
- var cwidth;
- var dz;
- var thumbsize = 68;
- var thumbspace = 72.3;
- var p1 = 0;
- var p2 = 0.35;
- var p3 = 0.7;
- var tt = 0.7;
- function Thumbrack()
- {
- super();
- this.arThumb = new Array();
- this.origheight = this._height;
- this.origwidth = this._width;
- EventCenter.access().addEventListener("thumbMovement",this);
- this.depth = 0;
- this.ctrTween = 0;
- EventCenter.access().addEventListener("goleft",this);
- EventCenter.access().addEventListener("goright",this);
- }
- function endslide()
- {
- this.ctrTween = this.ctrTween - 1;
- }
- function goleft()
- {
- if(this.ctrTween > 0)
- {
- return undefined;
- }
- if(this.cpos <= 0)
- {
- this.cpos = 0;
- return undefined;
- }
- var _loc3_ = 0;
- while(_loc3_ < this.arThumb.length)
- {
- var _loc2_ = this.arThumb[_loc3_];
- var _loc5_ = Math.floor(_loc3_ / 5);
- var _loc4_ = _loc3_ % 5 * 0.05;
- if(_loc5_ >= this.cpos + 3)
- {
- this.ctrTween = this.ctrTween + 1;
- _loc2_.slideTo(_loc2_._x + this.thumbspace,_loc2_._y,this.tt,"easeOutExpo",this.p1 + _loc4_,mx.utils.Delegate.create(this,this.endslide));
- _loc2_.fadeOut(1,"easeOutExpo",this.p1 + _loc4_);
- }
- else if(_loc5_ <= this.cpos - 1)
- {
- this.ctrTween = this.ctrTween + 1;
- _loc2_.slideTo(_loc2_._x + this.thumbspace,_loc2_._y,this.tt,"easeOutExpo",this.p3 + _loc4_,mx.utils.Delegate.create(this,this.endslide));
- _loc2_.fadeOut(0,"easeOutExpo",0);
- _loc2_.fadeIn(1,"easeOutExpo",this.p3 + _loc4_);
- }
- else
- {
- this.ctrTween = this.ctrTween + 1;
- _loc2_.slideTo(_loc2_._x + this.thumbspace,_loc2_._y,this.tt,"easeOutExpo",this.p2 + _loc4_,mx.utils.Delegate.create(this,this.endslide));
- }
- _loc3_ = _loc3_ + 1;
- }
- this.cpos = this.cpos - 1;
- }
- function goright()
- {
- if(this.ctrTween > 0)
- {
- return undefined;
- }
- if(this.cpos >= this.cwidth - 4)
- {
- this.cpos = this.cwidth - 4;
- return undefined;
- }
- var _loc3_ = 0;
- while(_loc3_ < this.arThumb.length)
- {
- var _loc2_ = this.arThumb[_loc3_];
- var _loc5_ = Math.floor(_loc3_ / 5);
- var _loc4_ = _loc3_ % 5 * 0.05;
- if(_loc5_ <= this.cpos)
- {
- this.ctrTween = this.ctrTween + 1;
- _loc2_.slideTo(_loc2_._x - this.thumbspace,_loc2_._y,this.tt,"easeOutExpo",this.p1 + _loc4_,mx.utils.Delegate.create(this,this.endslide));
- _loc2_.fadeOut(1,"easeOutExpo",this.p1 + _loc4_);
- }
- else if(_loc5_ >= this.cpos + 4)
- {
- this.ctrTween = this.ctrTween + 1;
- _loc2_.slideTo(_loc2_._x - this.thumbspace,_loc2_._y,this.tt,"easeOutExpo",this.p3 + _loc4_,mx.utils.Delegate.create(this,this.endslide));
- _loc2_.fadeOut(0,"easeOutExpo",0);
- _loc2_.fadeIn(1,"easeOutExpo",this.p3 + _loc4_);
- }
- else
- {
- this.ctrTween = this.ctrTween + 1;
- _loc2_.slideTo(_loc2_._x - this.thumbspace,_loc2_._y,this.tt,"easeOutExpo",this.p2 + _loc4_,mx.utils.Delegate.create(this,this.endslide));
- }
- _loc3_ = _loc3_ + 1;
- }
- this.cpos = this.cpos + 1;
- }
- function addThumb(thumbdata)
- {
- var _loc4_ = "item" + String(this.depth);
- var _loc2_ = this.dz.attachMovie(thumbdata.identifier,_loc4_,this.depth,{_x:0,_y:0});
- if(thumbdata.height == -1)
- {
- thumbdata.height = _loc2_._height;
- }
- _loc2_._y = thumbdata.height * this.depth;
- this.arThumb.push(_loc2_);
- this.depth = this.depth + 1;
- return _loc2_;
- }
- function thumbMovement(o)
- {
- if(o.horz == false)
- {
- var _loc2_ = Number(o.param);
- _loc2_ = (this.dz._height - this.origheight) / 100 * _loc2_;
- this.dz._y = - _loc2_;
- }
- else
- {
- var _loc3_ = Number(o.param);
- _loc3_ = (this.dz._width - this.origwidth) / 100 * _loc3_;
- this.dz._x = - _loc3_;
- }
- }
- }
-