Comunidad de diseño web y desarrollo en internet online

tabs no se hacer el swapdepths

Citar            
MensajeEscrito el 24 Oct 2008 08:58 pm
quiero hacer un menu en tabs como el de mccann.com ok, logro el efecto pero no logro que los tabs se cambien de profundidad entonces cuando me voy a otro tab se me frena el segundo con el primero o cualquiera.

aqui mi code

var velocidad:Number = .3;
var maxy:Number = 203;
for(i=0;i<7;i++){
this["tab"+i].useHandCursor = false;
}
tab1.onRollOver = function() {
this.onEnterFrame = function() {
if (tab1._y>203) {
tab1._y -= (tab1._y-203)*velocidad;
}
};
};
tab1.onRollOut = function(){
this.onEnterFrame = function(){
if(tab1._y<397){
tab1._y -= (tab1._y-397)*velocidad;
}
}
}

tab2.onRollOver = function() {
this.onEnterFrame = function() {
if (tab2._y>203) {
tab2._y -= (tab2._y-maxy)*velocidad;
}
};
};
tab2.onRollOut = function(){
this.onEnterFrame = function(){
if(tab2._y<397){
tab2._y -= (tab2._y-397)*velocidad;
}
}
}

...

y asi con los otros botones.
como hago?

Por sethladino

3 de clabLevel



Genero:Masculino  

Colombia

firefox
Citar            
MensajeEscrito el 25 Oct 2008 07:36 am
Postea los códigos entre tags de ActionScript para poderlos leer:

Código :

[as]
//---Codigos aqui
[/as]


Ahora sin analizar mucho... por qué utilizas un ciclo para poner la propiedad handCursor a los botones y no lo utilizas también para darle acciones, así tendrías un código más sencillo y que cuando realices algún cambio sólo tienes que hacerlo una vez.

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox
Citar            
MensajeEscrito el 27 Oct 2008 12:53 pm
Te estan aconsejando hacer esto:
for(i=0;i<7;i++){
this[t].onRollOut = function(){
// averiguar el nombre sobre el que estas parado cuando ocurre el evento
num=substr(this._name,3,1);
this.onEnterFrame = function(){
if(this["tab"+num]._y<397){
this["tab"+num]._y -= (this["tab"+num]._y-397)*velocidad;
}
}

lo mismo para RollOver...

Si queres swapear.. averigua el ultimo depht en cada boton.
y swapea cuando hace el RollOVer a un código superior, que se yo 1000 por ej.

.swapDepths(1000) o algo así.

Por DataGestion

15 de clabLevel



Genero:Femenino  

msie7

 

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