El codigo que mencionas solo se puede usar para textos, pero yo he hecho un scrollbar que te puede servir para cualquier movieclip, no importa lo que contenga el Clip, si texto o imagenes, o animaciones:
aqui tienes el codigo:
Código :
//----------------------------------------------------------------
// declarar variables
//----------------------------------------------------------------
// _global.ImgScroll debe contener la instancia del movieclip a scrollear
AreaScroll = Bar._height - BtnPos._height;
IncScroll = (_global.ImgScroll._height - Bar._height) / AreaScroll;
if (IncScroll < 0) IncScroll = 0;
_global.swScroll = false;
BtnPos.Top = BtnPos._y;
BtnPos.Bottom = BtnPos._y + AreaScroll;
//----------------------------------------------------------------
// creación de mascara
//----------------------------------------------------------------
_global.objMascara = this._parent.createEmptyMovieClip("MascaraScroll", 1);
_global.objMascara.lineStyle(1, 0x000000);
_global.objMascara.beginFill(0x000000);
_global.objMascara.moveTo(0, 0);
_global.objMascara.lineTo(_global.ImgScroll._width, 0);
_global.objMascara.lineTo(_global.ImgScroll._width, Bar._height);
_global.objMascara.lineTo(0, Bar._height);
_global.objMascara.lineTo(0, 0);
_global.objMascara._x = _global.ImgScroll._x;
_global.objMascara._y = _global.ImgScroll._y;
_global.ImgScroll.setMask(objMascara);
//*******************************************************************
BtnPos.onPress = function() {
_global.swScroll = true;
this.startDrag(false,this._x, this.Top,this._x, this.Bottom);
}
//*******************************************************************
BtnPos.onRelease = BtnPos.onReleaseOutside = function() {
this.stopDrag();
_global.swScroll = false;
}
//*******************************************************************
this.onEnterFrame = function() {
// trace("entro a scroll");
if (!_global.swScroll) return;
if (_global.ImgScroll._height < Bar._height) return;
IncScroll = (_global.ImgScroll._height - Bar._height) / AreaScroll;
if (IncScroll < 0) IncScroll = 0;
PosAct = BtnPos._y - BtnPos.Top;
_global.ImgScroll._y = this._y - (PosAct * IncScroll);
trace(_global.ImgScroll._name + "PosY=" + _global.ImgScroll._y);
trace(PosAct * IncScroll);
}
escribeme y te mando el FLA con el ejemplo.