home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Esportes
/
CrossingCup.swf
/
scripts
/
__Packages
/
CSlider.as
< prev
next >
Wrap
Text File
|
2007-12-11
|
1KB
|
55 lines
class CSlider extends MovieClip
{
function CSlider()
{
super();
this.origwidth = this._width;
this.dragging = false;
}
function onPress()
{
_global.__DISPATCH({type:"sliderpress",param:this});
if(!this.dragging)
{
this.setWidth();
}
this.dragging = true;
}
function onRelease()
{
_global.__DISPATCH({type:"sliderrelease",param:this});
this.dragging = false;
}
function onReleaseOutside()
{
_global.__DISPATCH({type:"sliderrelease",param:this});
this.dragging = false;
}
function setWidth()
{
var _loc2_ = this._xmouse;
if(_loc2_ > this.origwidth)
{
_loc2_ = this.origwidth;
}
this.slidebar._width = _loc2_;
}
function setVal(val)
{
this.slidebar._width = val * (this.origwidth / 100);
}
function getVal()
{
return this.slidebar._width / this.origwidth * 100;
}
function onMouseMove()
{
if(!this.dragging)
{
return undefined;
}
_global.__DISPATCH({type:"slidermove",param:this});
this.setWidth();
}
}