¡Hola! ¡Necesito ayuda! No se resolver lo siguiente,
Tengo un clip de película que es un texto con un scroll deslizador.
Este clip contiene dentro una capa con un dragger(el deslizador), otra capa con una máscara del texto (theMask)y en otra un clip con el texto (theText) y además está la capa de las acciones con el siguiente script:
targY = 0;
dragger._x = theMask._width;
dragger.onPress = function() {
startDrag(this, false, this._x, 0, this._x, theMask._height-this._height);
};
dragger.onRelease = dragger.onReleaseOutside=function () { stopDrag();};
theText.setMask(theMask);
theText.onEnterFrame = function() {
scrollAmount = (this._height-(theMask._height/1.3))/(theMask._height-dragger._height);
targY = -dragger._y*scrollAmount;
this._y -= (this._y-targY)/5;
};
Me funciona perfectamente una vez. Mi problema es que ahora quiero volverlo a usar con otro texto. Cambio el clip del texto y creo uno nuevo con otro nombre (en lugar de theText lo llamo theText2)
targY = 0;
dragger._x = theMask._width;
dragger.onPress = function() {
startDrag(this, false, this._x, 0, this._x, theMask._height-this._height);
};
dragger.onRelease = dragger.onReleaseOutside=function () { stopDrag();};
theText2.setMask(theMask);
theText2.onEnterFrame = function() {
scrollAmount = (this._height-(theMask._height/1.3))/(theMask._height-dragger._height);
targY = -dragger._y*scrollAmount;
this._y -= (this._y-targY)/5;
};
El texto me lo cambia pero en lugar de presentarlo quieto en su lugar hasta que yo lo mueva con el deslizador, se me desplaza hacia arriba y se queda a mitad de texto sin poder ver la parte de arriba. A partir de ahí yo lo puedo mover hacia abajo y hasta ese punto en el que se paró.
¿Qué he de cambiar en el script para que me salga tan bien como antes, sin moverse?
Por favor, que alguien me ayude...!!!