Comunidad de diseño web y desarrollo en internet online

En que parte me hacen conflicto estas acciones?

Citar            
MensajeEscrito el 19 Ene 2010 01:32 am
Wenas, resulta que estoy tratando de hacer una web en AS2 y esta incorpora una DIAGRAMACION LIQUIDA para uqe se ajuste a la ventana, y tambien en el inicio tiene un SCROLL BAR + EASING, pero cuando los tengo los dos juntos me ocurre un problema que toda la animacion flash se me desplaza hacia abajo a la derecha. Entonces quisiera saber cual es el problema, si me pudiesen ayudar viendo como arreglarlo.

ACCION DIAGRAMACION LIQUIDA

Código ActionScript :

// todos los clips ajustables deben tener su origen
// en su esquina superior inquierda
// ajustes iniciales -----------------
// no queremos que se cambie la escala de la película
Stage.scaleMode = "noScale";
// la peli se ajusta arriba a la izquierda
Stage.align = "TL";
// definimos el tamaño mínimo de la peli
ancho_minimo = 1024;
alto_minimo = 768;
// en este array almaceno los clips que se tienen
// que ajustar al cambiar el tamaño de la pantalla
clips_ajustables = new Array();
// definimos el objeto que va a detectar el cambio de tamaño
myListener = new Object();
// asociamos el objeto al stage para detectar los cambios
// de tamaño del stage
Stage.addListener(myListener);
// ejecuto la función rec al cambiar el tamaño
myListener.onResize = rec;
function rec() {
   // definimos el alto y ancho que queda
   // después de reescalar, si no alcanza
   // los mínimos, asignamos éstos
   alto = Stage.height;
   if (alto<alto_minimo) {
      alto = alto_minimo;
   }
   ancho = Stage.width;
   if (ancho<ancho_minimo) {
      ancho = ancho_minimo;
   }
   for (var g = 0; clips_ajustables[g]; g++) {
      clips_ajustables[g].alinear();
   }
}
// resolución total
//altoTotal = System.capabilities.screenResolutionY;
//anchoTotal = System.capabilities.screenResolutionX;
//alto = stage.height;
//ancho = stage.width;
// con esta función implemento el método setTipo
// en todos los movieClip.
// Los valores para ajuste_x son "izquierda", "derecha" y "centrar"
// Los valores para ajuste_y son "arriba", "abajo" y "centrar"
// Los valores para ajuste_width son false y un número que
// indica el porcentaje de la anchura del clip respecto de la escena
// Los valores para ajuste_height son false y un número que
// indica el porcentaje de la altura del clip respecto de la escena
MovieClip.prototype.setAjuste = function(ajuste_x, ajuste_y, ajuste_width, ajuste_height) {
   // estos ajustes nos dicen como se tiene modificar el
   // el clip al redimensionar
   this.ajuste_x = ajuste_x;
   this.ajuste_y = ajuste_y;
   this.ajuste_width = ajuste_width;
   this.ajuste_height = ajuste_height;
   // almaceno la posición y el tamaño
   // iniciales de los clips ajustables
   this.x0 = this._x;
   this.y0 = this._y;
   this.w0 = this._width;
   this.h0 = this._height;
   this.ajustePersonalizado = false;
   // almaceno el clip en el array
   clips_ajustables.push(this);
   this.alinear();
};
// función para alinear los clips en funcion de su tipo
MovieClip.prototype.alinear = function() {
   // si se le ha pasado el parámetro ajuste_width en la función
   // setAjuste, significa que debo ajustar el ancho del clip
   // cuando reescalo la pantalla
   if (this.ajuste_width) {
      if (this.ajuste_width.indexOf("%") != -1) {
         // si el valor de this.ajuste_width es un porcentaje
         this._width = (_root.ancho*parseInt(this.ajuste_width))/100;
      } else {
         // si el valor de this.ajuste_width es un número de píxeles
         this._width = this.ajuste_width;
      }
   }
   // lo mismo con el ajuste del alto del clip
   if (this.ajuste_height) {
      if (this.ajuste_height.indexOf("%") != -1) {
         this._height = (_root.alto*parseInt(this.ajuste_height))/100;
      } else {
         this._height = this.ajuste_height;
      }
   }
   // ajustes de posicion de los clips
   if (this.ajuste_x == "izquierda") {
      this._x = this.x0;
   }
   if (this.ajuste_x == "derecha") {
      this._x = Math.round(this.x0+(_root.ancho-_root.ancho_minimo));
   }
   if (this.ajuste_x == "centrar") {
      this._x = Math.round((_root.ancho-this._width)*0.5);
   }
   if (this.ajuste_y == "arriba") {
      this._y = this.y0;
   }
   if (this.ajuste_y == "abajo") {
      this._y = Math.round(this.y0+(_root.alto-_root.alto_minimo));
   }
   if (this.ajuste_y == "centrar") {
      this._y = Math.round((_root.alto-this._height)*0.5);
   }
   // si el clip tiene un ajuste especial ejecuto su función ajustar
   // que hemos definido en el onClipEvent(load) del clip
   if (this.ajustePersonalizado) {
      this.ajustar();
   }
};



ACCION SCROLL BAR + EASING

Código ActionScript :

fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=false;
space = 0;
friction = 0.3;
speed = 4;
y = dragger._y;
top = main._y;
bottom = main._y+mask_mc._height-main._height-space;
dragger.onPress = function() {
   drag = true;
   this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
   dragger.scrollEase();
};
dragger.onMouseUp = function() {
   this.stopDrag();
   drag = false;
};
bar.onPress = function() {
   drag = true;
   if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
      this._parent.dragger._y = this._parent._ymouse;
      this._parent.dragger._y = this._y+this._height-this._parent.dragger._height;
   } else {
      this._parent.dragger._y = this._parent._ymouse;
   }
   dragger.scrollEase();
};
bar.onMouseUp = function() {
   drag = false;
};
moveDragger = function (d) {
   if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
      clearInterval(myInterval);
   } else {
      dragger._y += d;
      dragger.scrollEase();
      updateAfterEvent();
   }
};
up_btn.onPress = function() {
   myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
   myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
   clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
   this.onEnterFrame = function() {
      if (Math.abs(dy) == 0 && drag == false) {
         delete this.onEnterFrame;
      }
      r = (this._y-y)/(bar._height-this._height);
      dy = Math.round((((top-(top-bottom)*r)-main._y)/speed)*friction);
      main._y += dy;
   };
};


Saludos

Por vicnaz

25 de clabLevel



 

firefox
Citar            
MensajeEscrito el 19 Ene 2010 03:28 am
Ja! Yo personalmente no te leeré todo tu código para resolverte tu problema. Estamos para guairte no hacer tu trabajo.

Saludos, Hernán . -

Por Hernán

BOFH

6148 de clabLevel

19 tutoriales
23 articulos

Genero:Masculino   REC Desarrollador de GAIA

Marketing & IT

firefox
Citar            
MensajeEscrito el 19 Ene 2010 04:59 pm
y mucho menos en AS2 :@

Por jcruz

54 de clabLevel



Genero:Masculino  

Trabajo por comida!

firefox
Citar            
MensajeEscrito el 20 Ene 2010 04:13 am

jcruz escribió:

y mucho menos en AS2 :@

y para que pones :@???

Tiene algo de malo el AS2? acaso es mas dificil que el AS3?, pues yo creo que no. Aun que yo no conosco mucho de esto, yo solo queria saber si alguien me podria ayudar y no postear SPAM como "jcruz".

Salu2

Por vicnaz

25 de clabLevel



 

firefox
Citar            
MensajeEscrito el 21 Ene 2010 01:07 am
La verdad yo aun no me he migrado al 100% a AS3, pero la programación en sí misma radica en la lógica no en el lenguaje, si bien me encanta muchas cosas nuevas que tiene el AS 3 (Y por eso me estoy migrando) no tiene nada que ver con programar bien o mal y menos lo que haces entender. He visto tus códigos en algunos post, yo mejor miraría mi manera de programar no el lenguaje jcruz.

Saludos, Hernán . -

Por Hernán

BOFH

6148 de clabLevel

19 tutoriales
23 articulos

Genero:Masculino   REC Desarrollador de GAIA

Marketing & IT

firefox
Citar            
MensajeEscrito el 21 Ene 2010 07:51 pm
Tienes razón, no soy programador. Pero trato de ayudar a quienes puedo :D. Por otro lado vicnaz pareces muy alterado, tranquilo que ya encontrarás solución a tus problemas. Salud

Por jcruz

54 de clabLevel



Genero:Masculino  

Trabajo por comida!

firefox
Citar            
MensajeEscrito el 21 Ene 2010 08:24 pm

jcruz escribió:

y mucho menos en AS2 :@

Pues esto no es de mucha ayuda.

Por checheno

528 de clabLevel

3 tutoriales

 

Mar del Plata - Argentina

firefox

 

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