Comunidad de diseño web y desarrollo en internet online

texto que se mueve con flechita

Citar            
MensajeEscrito el 13 Abr 2005 07:55 pm
:shock: hola tengo que hacer (lo que creo que se llama un scroll) algun tipo de barra que me permita desplazar el texto (+-).

No estoy buscando nada extraño, las barras que estan siempre a la derecha de una ventana que permiten subir y bajar para mostrar una parte de la pantalla que esta oculta salvo que tengo que hacerla en el flash mx (no 2004) y en un sector de la pantalla (no toda)

si alguien me puede ayudar...
...mmm... dios le traera dicha!!!!! ^^
[size=18][/size]

Por stereo-tipo

10 de clabLevel



 

msie
Citar            
MensajeEscrito el 13 Abr 2005 09:24 pm
A ver si puedes adaptar este código:

Código :

//INICIALIZAMOS LAS POSICIONES DE LOS BOTONES
arriba_btn._x = 211;
arriba_bnt._y = 54;
abajo_btn._x = 211;
abajo_btn._y = 74;
deslizador_btn._x = 211;
deslizador_btn._y = 205;

//SCROLLEAR ARRIBA Y ABAJO ------------------------------------------------
deslizador_btn.onPress = function(){
   startDrag(this, false, 210.3, 74, 210.3, 185);
   arrastrarInt = setInterval(arrastrar, 100);
}
deslizador_btn.onRelease = function(){
   stopDrag();
   clearInterval(arrastrarInt);
}
arriba_btn.onPress = function(){
   arribaInt = setInterval(scrollArriba, 100);
}
arriba_btn.onRelease = function(){
   clearInterval(arribaInt);
}
abajo_btn.onPress = function(){
   abajoInt = setInterval(scrollAbajo, 100);
}
abajo_btn.onRelease = function(){
   clearInterval(abajoInt);
}

/* FUNCIONES ****************************************/
function scrollArriba(){
   if (mensaje_txt.scroll > 1){
      mensaje_txt.scroll--;
      deslizador_btn._y = mensaje_txt.scroll * (111 / (mensaje_txt.maxscroll)) + 74;
   }
   else if (mensaje_txt.scroll == 1){
      deslizador_btn._y = 74;
   }
}

function scrollAbajo(){
   if (mensaje_txt.scroll < mensaje_txt.maxscroll){
      mensaje_txt.scroll++;
      deslizador_btn._y = mensaje_txt.scroll * (111 / (mensaje_txt.maxscroll)) + 74;
   }
}

function arrastrar(){
   mensaje_txt.scroll = (deslizador_btn._y - 74) * (mensaje_txt.maxscroll / 111);
}


Crea tres botones que se llamen arriba_btn, abajo_btn y deslizador_btn. Luego pon una caja de texto que se llame mensaje_txt y ya debería funcionar.

Deu!! ^^

Por Elecash

Claber

8126 de clabLevel

37 tutoriales
19 articulos
13 ejemplos

  Bastard Operators From Hell Desarrollador de GAIA Premio_Secretos Héroes

BarnaCity

firefox
Citar            
MensajeEscrito el 14 Abr 2005 03:07 am
hola... muy bueno el codigo, yo lo pude adaptar a mi campo de texto. Pero tengo otra duda, si quiziera solo "arrastrar" un boton e ir bajando y subiendo dentro de un contorno indicado, como se podria hacer?

saludos, y de antemano muchas gracias.
rzs.

Por rzs

35 de clabLevel



 

msie
Citar            
MensajeEscrito el 14 Abr 2005 07:28 am
Pues quita el código que sobra :shock:

Código :

//INICIALIZAMOS LAS POSICIONES DE LOS BOTONES
deslizador_btn._x = 211;
deslizador_btn._y = 205;

//SCROLLEAR ARRIBA Y ABAJO ------------------------------------------------
deslizador_btn.onPress = function(){
   startDrag(this, false, 210.3, 74, 210.3, 185);
   arrastrarInt = setInterval(arrastrar, 100);
}
deslizador_btn.onRelease = function(){
   stopDrag();
   clearInterval(arrastrarInt);
}

/* FUNCIONES ****************************************/
function arrastrar(){
   mensaje_txt.scroll = (deslizador_btn._y - 74) * (mensaje_txt.maxscroll / 111);
} 


Lo que he hecho ha sido quitar las flechas y dejar el deslizador...

Deu!!

Por Elecash

Claber

8126 de clabLevel

37 tutoriales
19 articulos
13 ejemplos

  Bastard Operators From Hell Desarrollador de GAIA Premio_Secretos Héroes

BarnaCity

clabbrowser
Citar            
MensajeEscrito el 15 Abr 2005 11:19 pm
no me va :< ... no supe poner las pocisiones correctas.... quiero q se mueva entre el

(desde)
x= 700.0
y=257.0

(hasta)
x=700.
y=360

lo he puesto así:

Código :

//INICIALIZAMOS LAS POSICIONES DE LOS BOTONES 
deslizador_btn._x = 700; 
deslizador_btn._y = 257; 

//SCROLLEAR ARRIBA Y ABAJO ------------------------------------------------ 
deslizador_btn.onPress = function(){ 
   startDrag(this, false, 700, 257, 700, 360); 
   arrastrarInt = setInterval(arrastrar, 100); 
} 
deslizador_btn.onRelease = function(){ 
   stopDrag(); 
   clearInterval(arrastrarInt); 
} 

/* FUNCIONES ****************************************/ 
function arrastrar(){ 
   myTexto2.scroll = (deslizador_btn._y - 74) * (myTexto2.maxscroll / 111); 
} 


haber si alguien me puede ayudar ^^

Por rzs

35 de clabLevel



 

msie

 

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