Hello everybody from Buenos Aires, Argentina - This is my first msg to the
list!

Can somebody help me to attach a simple sound on rollover to this set of
buttons??

I've tried so many times that I'm at the point of giving up! :(

Thank u very much in advance!


Kind regards.


Domecq®



Here is the code:


// Acciones del menú

miLista = new Array();
miLista[1] = "sonido1";
i = 1;
miSonido = new Sound();

menu_mc.boton1_mc.onRollOver=menu_mc.boton2_mc.onRollOver=menu_mc.boton3_mc.
onRollOver=menu_mc.boton4_mc.onRollOver=menu_mc.boton5_mc.onRollOver=functio
n () {
        miSonido.attachSound(miLista[i]);
        misonido.start(true);
        i == (1) ? i=1 : i++;
};


// -- array cuyos elementos se corresponden con las opciones del menú
opciones = new Array();
opciones[1] = "01 Agencia";
opciones[2] = "02 Servicios";
opciones[3] = "03 Clientes";
opciones[4] = "04 Asociados";
opciones[5] = "05 Contacto";
// -- asignar texto a cada botón del menú
menu_mc.boton1_mc.texto.text = opciones[1];
menu_mc.boton2_mc.texto.text = opciones[2];
menu_mc.boton3_mc.texto.text = opciones[3];
menu_mc.boton4_mc.texto.text = opciones[4];
menu_mc.boton5_mc.texto.text = opciones[5];

// -- crea un formato de texto
formato = new TextFormat();
formato.font = "verdana";
formato.size = 10;
formato.color = 0xffffff;

// -- formatea el textField de cada botón
menu_mc.boton1_mc.texto.setTextFormat(formato);
menu_mc.boton2_mc.texto.setTextFormat(formato);
menu_mc.boton3_mc.texto.setTextFormat(formato);
menu_mc.boton4_mc.texto.setTextFormat(formato);
menu_mc.boton5_mc.texto.setTextFormat(formato);

// -- acciones evento onRollOver
menu_mc.boton1_mc.onRollOver =
menu_mc.boton2_mc.onRollOver=menu_mc.boton3_mc.onRollOver=menu_mc.boton4_mc.
onRollOver=menu_mc.boton5_mc.onRollOver=function () { formato.color =
0xff0000;this.texto.setTextFormat(formato);};

// -- acciones evento onRollOut
menu_mc.boton1_mc.onRollOut =
menu_mc.boton2_mc.onRollOut=menu_mc.boton3_mc.onRollOut=menu_mc.boton4_mc.on
RollOut=menu_mc.boton5_mc.onRollOut=function () { formato.color =
0xffffff;this.texto.setTextFormat(formato);};

// -- acciones evento onPress
menu_mc.boton1_mc.onRelease = function() {
        restaurar();
        this.enabled = false;
        this.texto.text = "__  "+opciones[1];
        menu_mc.seleccion.text = opciones[1];
        gotoAndPlay("agencia");
};
menu_mc.boton2_mc.onRelease = function() {
        restaurar();
        this.enabled = false;
        this.texto.text = "__  "+opciones[2];
        menu_mc.seleccion.text = opciones[2];
        gotoAndPlay("servicios");
};
menu_mc.boton3_mc.onRelease = function() {
        restaurar();
        this.enabled = false;
        this.texto.text = "__  "+opciones[3];
        menu_mc.seleccion.text = opciones[3];
        gotoAndPlay("clientes");
};
menu_mc.boton4_mc.onRelease = function() {
        restaurar();
        this.enabled = false;
        this.texto.text = "__  "+opciones[4];
        menu_mc.seleccion.text = opciones[4];
                gotoAndPlay("asociados");
};
menu_mc.boton5_mc.onRelease = function() {
        restaurar();
        this.enabled = false;
        this.texto.text = "__ "+opciones[5];
        menu_mc.seleccion.text = opciones[5];
                        gotoAndPlay("contacto");
};
// --
this.onMouseMove = function() {
        if (menu_mc.hitTest(_xmouse, _ymouse)) {
                menu_mc.gotoAndStop("menu");
                menu_mc.bakground_mc.escalary(125, 3);
        } else {
                menu_mc.gotoAndStop("nomenu");
        }
};

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to