Comunidad de diseño web y desarrollo en internet online

SCROLL BAR

Citar            
MensajeEscrito el 01 Nov 2006 05:44 pm
Tomé uno del ejemplos de ScrollBar de la página, pero tengo un problemita. Cuando llega al final del texto, continua "scrolleando" un poco más, de manera q se me ve un fondo blanco a continuación del texto, q no debería de estar. Como puedo solucionarlo???

Por caro_dcv

1 de clabLevel



Genero:Femenino  

safari
Citar            
MensajeEscrito el 04 Nov 2006 01:07 am
Tal vez te pueda ayudar un poco esto:

Código :

//set a variable & initialize to zero
targY = 0;
//set the x position of the dragger equal to the mask 
dragger._x = theMask._width;
dragger._y=0;
//set the drag action of the dragger
//drag is restricted to the height of the mask
dragger.onPress = function() {
   startDrag(this, false, this._x, 0, this._x, theMask._height-this._height);
};
//stop the drag
dragger.onRelease = dragger.onReleaseOutside=function () {
   stopDrag();
};
//set the mask for the text
theText.setMask(theMask);
//the scrolling animation
theText.onEnterFrame = function() {
   /*set a variable 
      this variable basically stores info regarding what fraction of the total text 
      is being displayed through the mask and ensures that dragging the dragger
      from top to bottom will reveal all the text.
      this allows you to change the amount of text and the scroller will update itself
      */
   scrollAmount = (this._height-(theMask._height/1.3))/(theMask._height-dragger._height);
   //set a new target y position
   targY = -dragger._y*scrollAmount;
   //set the y of the text to 1/5 of the distance between its current y and the target y
   //change the 5 to a lower number for faster scrolling or a higher number for slower scrolling
   this._y -= (this._y-targY)/5;
};




Tienes que usar 3 mc (dragger, theMask, theText)

Por nasho

Claber

908 de clabLevel

1 tutorial

Genero:Masculino  

Web Developer

msie
Citar            
MensajeEscrito el 06 Nov 2006 01:11 pm
Es la primera vez que me meto en el foro y parece que el resultado fue un éxito. Voy a hacer la prueba con el código! Gracias por tu respuesta! caro!

Por caro_dcv

1 de clabLevel



Genero:Femenino  

safari

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.