Comunidad de diseño web y desarrollo en internet online

Cambiar codigo actionscrip1 a actionscript2

Citar            
MensajeEscrito el 16 Jun 2007 12:17 pm
Hola,
queria cambiar este code de actionscript 1 a 2:

Código :

curr_y = ../scrollbar:_y;
scroll_pos = curr_y-../:min_pos;
calculo = (scroll_pos*relacion)*-1;
direccion = (../:step)*(../:dir);
new_pos = Number(curr_y)+Number(direccion);
if (Number(direccion)>0) {
   if (Number(new_pos)<Number(../:max_pos)) {
      setProperty("../scrollbar", _y, new_pos);
   } else {
      setProperty("../scrollbar", _y, ../:max_pos);
   }
} else if (Number(direccion)<0) {
   if (Number(new_pos)>Number(../:min_pos)) {
      setProperty("../scrollbar", _y, new_pos);
   } else {
      setProperty("../scrollbar", _y, ../:min_pos);
   }
}
setProperty("../txt", _y, calculo);

el problema esta en los ../

Código :

../txt

y en los ../:

Código :

../:step

Segun he visto por aqui ../: es lo mismo que this._parent/
pero la sintaxis ../ no se como interpretarla.
Alguien podria echarme una mano con esto o decirme algun tuto?
Gracias de antemano

Por celentano

Claber

123 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 19 Jun 2007 10:10 am

Código :

with(this._parent){
  curr_y = scrollbar._y;
  scroll_pos = curr_y - min_pos;
  direccion = step*dir;
  new_pos = curr._y + direccion;
  if (direccion>0) {
      if (new_pos < max_pos) {
         scrollbar._y, = new_pos;
      } else { scrollbar._y = max_pos;}
   } 
  else if (direccion<0) {
      if (new_pos > min_pos) {
         scrollbar._y = new_pos;
      } else { scrollbar._y = min_pos);}
  }
  txt._y = calculo;
}

Por Teseo

SWAT Team

1780 de clabLevel

14 tutoriales

Genero:Masculino   SWAT

firefox

 

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