Comunidad de diseño web y desarrollo en internet online

problema con menu hecho con movieclips

Citar            
MensajeEscrito el 27 Oct 2009 10:53 am
Saludos estoy tratando de hacer unos botones que sus funciones normales son onrollover onrollout onpress y onrelease eso es facil pero son movieclips por que tienen que permanecer en un estado si ya fueron activados y que no funcionen si ya estan en releas o lo que seria como focus y esto lo hize haciendo 4 frames en cada uno una funcion que diga que frame tiene que ejecutar y hasta alli tengo todo bien ahora lo siguiente es que si lo suelto me llebe al frame estatico de este y alli permanesca lo hize creando 4 frames en mi linea principal e indicandole que en una funcion onenterframe ese movie clip sea llevado al frame statico alli iniciaron los problemas por que los dos botones que ya programe en efecto lo hacen pero tambien hace un brinco medio raro en la programacion se los dejo el flash asi como el codigo que tengo y si de casualidad alguien me puede comentar como puedo cargar un div con el flash seria genial ya que tengo horas buscandolo y no encuentro nada que me ayude o se asemeje lo que quiero es que solo se cambie lo que comprenderia al cuerpo en una alineaccion con css para que solo tenga que cargar este menu una vez y solo cambie esa parte sin afectar al resto del sitio.

ESTO CORRESPONDE AL PRIMER FRAME DE MI LINEA PRINCIPAL:

Código ActionScript :

stop();
//home//
bh.onEnterFrame = function () {
   this.gotoAndStop(4);
}
bh.onRollOver = function(){
   if(this._currentframe == 4)
   { this.stop();}
   else
   { this.gotoAndStop(2);
   }
};
bh.onRollOut = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (1);}
};
bh.onPress = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (3);}
};
bh.onRelease = function(){
   this.gotoAndStop (4);
   _root.gotoAndStop(1);
   };
//servicios//
bs.onEnterFrame = function () {
   this.gotoAndStop(1);
}
bs.onRollOver = function(){
   if(this._currentframe == 4)
   { this.stop();}
   else
   { this.gotoAndStop(2);
   }
};
bs.onRollOut = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (1);}
};
bs.onPress = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (3);}
};
bs.onRelease = function(){
   this.gotoAndStop (4);
   _root.gotoAndStop(2);
   };
//ubicacion//
bu.onRollOver = function(){
   if(this._currentframe == 4)
   { this.stop();}
   else
   { this.gotoAndStop(2);
   }
};
bu.onRollOut = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (1);}
};
bu.onPress = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (3);}
};
bu.onRelease = function(){
   this.gotoAndStop (4);
   };
   //mail//
bm.onRollOver = function(){
   if(this._currentframe == 4)
   { this.stop();}
   else
   { this.gotoAndStop(2);
   }
};
bm.onRollOut = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (1);}
};
bm.onPress = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (3);}
};


ESTO A LA SEGUNDA (notaran pequeño cambio nada mas lo que hize para que el siguiente boton fuera el activo):

Código ActionScript :

stop();
//home//
bh.onEnterFrame = function () {
   this.gotoAndStop(1);
}
bh.onRollOver = function(){
   if(this._currentframe == 4)
   { this.stop();}
   else
   { this.gotoAndStop(2);
   }
};
bh.onRollOut = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (1);}
};
bh.onPress = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (3);}
};
bh.onRelease = function(){
   this.gotoAndStop (4);
   gotoAndStop(1);
   };
//servicios//
bs.onEnterFrame = function () {
   this.gotoAndStop(4);
}
bs.onRollOver = function(){
   if(this._currentframe == 4)
   { this.stop();}
   else
   { this.gotoAndStop(2);
   }
};
bs.onRollOut = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (1);}
};
bs.onPress = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (3);}
};
bs.onRelease = function(){
   this.gotoAndStop (4);
   gotoAndStop(2);
   };
//ubicacion//
bu.onRollOver = function(){
   if(this._currentframe == 4)
   { this.stop();}
   else
   { this.gotoAndStop(2);
   }
};
bu.onRollOut = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (1);}
};
bu.onPress = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (3);}
};
bu.onRelease = function(){
   this.gotoAndStop (4);
   };
   //mail//
bm.onRollOver = function(){
   if(this._currentframe == 4)
   { this.stop();}
   else
   { this.gotoAndStop(2);
   }
};
bm.onRollOut = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (1);}
};
bm.onPress = function(){
   if (this._currentframe == 4)
   {bh.stop();}
   else { this.gotoAndStop (3);}
};
bm.onRelease = function(){
   this.gotoAndStop (4);
   };


y como ultimo les dejo el sfw para que vean la diferencia los ultimos dos botones no tienen la programacion para que pasen a ser activos y son como se deberian ver los primeros dos ustedes lo veran es bastante obvio el error. ¡¡Muchas gracias espero no haberlos hecho bolas no soy muy bueno programando apenas inicio en esto.


Por odnamradg

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 27 Oct 2009 12:50 pm
A simple vista la programación de los botones se puede resolver con dos loops de 5 líneas, si puedes resumir tu objetivo en 4 líneas lo vemos (síntesis = claridad)

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

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