Varias fotos. Mira voy a colocar el codigo que quiero simplificar. Es una groseria pero...
Código :
btn_foto3.onRollOver=function(){
var camara:Sound= new Sound();
camara.attachSound("Camera");
camara.setVolume(100);
camara.start();
btn_foto3.conte_foto2.luz("in",1);
marco_foto1.swapDepths(22);
btn_foto3.swapDepths(24);
conte_foto2.swapDepths(23);
}
btn_foto3.onRollOut=function(){
stopAllSounds();
marco_foto1.swapDepths(1);
btn_foto3.swapDepths(3);
conte_foto2.swapDepths(2);
var trans:Transform= new Transform(btn_foto3.conte_foto2);
var gris:ColorTransform= new ColorTransform(1,1,1,1,-30,-30,-30,-120);
trans.colorTransform=gris;
}
//----------------------------------------------
//----------------------------------------------
btn_foto6.onRollOver=function(){
var camara:Sound= new Sound();
camara.attachSound("Camera");
camara.setVolume(100);
camara.start();
btn_foto6.conte_foto5.luz("in",1);
marco_foto4.swapDepths(22);
btn_foto6.swapDepths(24);
conte_foto5.swapDepths(23);
}
btn_foto6.onRollOut=function(){
stopAllSounds();
marco_foto4.swapDepths(4);
btn_foto6.swapDepths(6);
conte_foto5.swapDepths(5);
var trans:Transform= new Transform(btn_foto6.conte_foto5);
var gris:ColorTransform= new ColorTransform(1,1,1,1,-30,-30,-30,-120);
trans.colorTransform=gris;
}
//-------------------------------------------
//-------------------------------------------
btn_foto9.onRollOver=function(){
var camara:Sound= new Sound();
camara.attachSound("Camera");
camara.setVolume(100);
camara.start();
btn_foto9.conte_foto8.luz("in",1);
marco_foto7.swapDepths(22);
btn_foto9.swapDepths(24);
conte_foto8.swapDepths(23);
}
btn_foto9.onRollOut=function(){
stopAllSounds();
marco_foto7.swapDepths(7);
btn_foto9.swapDepths(9);
conte_foto8.swapDepths(8);
var trans:Transform= new Transform(btn_foto9.conte_foto8);
var gris:ColorTransform= new ColorTransform(1,1,1,1,-30,-30,-30,-120);
trans.colorTransform=gris;
}
//-----------------------------------------------
//-----------------------------------------------
btn_foto12.onRollOver=function(){
var camara:Sound= new Sound();
camara.attachSound("Camera");
camara.setVolume(100);
camara.start();
btn_foto12.conte_foto11.luz("in",1);
marco_foto10.swapDepths(22);
btn_foto12.swapDepths(24);
conte_foto11.swapDepths(23);
}
btn_foto12.onRollOut=function(){
stopAllSounds();
marco_foto10.swapDepths(10);
btn_foto12.swapDepths(12);
conte_foto11.swapDepths(11);
var trans:Transform= new Transform(btn_foto12.conte_foto11);
var gris:ColorTransform= new ColorTransform(1,1,1,1,-30,-30,-30,-120);
trans.colorTransform=gris;
}
//-----------------------------------------
//-----------------------------------------
btn_foto15.onRollOver=function(){
var camara:Sound= new Sound();
camara.attachSound("Camera");
camara.setVolume(100);
camara.start();
btn_foto15.conte_foto14.luz("in",1);
marco_foto13.swapDepths(22);
btn_foto15.swapDepths(24);
conte_foto14.swapDepths(23);
}
btn_foto15.onRollOut=function(){
stopAllSounds();
marco_foto13.swapDepths(13);
btn_foto15.swapDepths(15);
conte_foto14.swapDepths(14);
var trans:Transform= new Transform(btn_foto15.conte_foto14);
var gris:ColorTransform= new ColorTransform(1,1,1,1,-30,-30,-30,-120);
trans.colorTransform=gris;
}
//-----------------------------------
//-----------------------------------
btn_foto18.onRollOver=function(){
var camara:Sound= new Sound();
camara.attachSound("Camera");
camara.setVolume(100);
camara.start();
btn_foto18.conte_foto17.luz("in",1);
marco_foto16.swapDepths(22);
btn_foto18.swapDepths(24);
conte_foto17.swapDepths(23);
}
btn_foto18.onRollOut=function(){
stopAllSounds();
marco_foto16.swapDepths(16);
btn_foto18.swapDepths(18);
conte_foto17.swapDepths(17);
var trans:Transform= new Transform(btn_foto18.conte_foto17);
var gris:ColorTransform= new ColorTransform(1,1,1,1,-30,-30,-30,-120);
trans.colorTransform=gris;
}
//------------------------------------
//------------------------------------
btn_foto21.onRollOver=function(){
var camara:Sound= new Sound();
camara.attachSound("Camera");
camara.setVolume(100);
camara.start();
btn_foto21.conte_foto20.luz("in",1);
marco_foto19.swapDepths(22);
btn_foto21.swapDepths(24);
conte_foto20.swapDepths(23);
}
btn_foto21.onRollOut=function(){
stopAllSounds();
marco_foto19.swapDepths(19);
btn_foto21.swapDepths(21);
conte_foto20.swapDepths(20);
var trans:Transform= new Transform(btn_foto21.conte_foto20);
var gris:ColorTransform= new ColorTransform(1,1,1,1,-30,-30,-30,-120);
trans.colorTransform=gris;
}Como vez es mucho codigo y es lo mismo y se que puedo simplificar pero no me salio po esta seccion:
btn_foto21.conte_foto20.luz("in",1);