Navegando por la red encontre un codigo para (segun entendi) poner un controlador de volumen de esos redondos que giran en mi proyecto, yo uso flash 8 con as2, y no se si sera por eso, pero segun pego el codigo y le doy a la opcion de corregirlo, me saltan varios errores.
Aqui abajo les dejo la pagina de donde lo copie ( esta en ingles) y el codigo por si alguien me hace el favor de ayudarme a corregir esos errores indicandome que debo de hacer y donde he de modificarlo, gracias:
La pagina es esta:
http://board.flashkit.com/board/showthread.php?t=780533
Y el codigo es el siguiente:
Código PHP :
Create two layers. One for attaching the global sound object,
and the other for your animated knob.
Sound Layer:
-------------
s = new Sound(this);
s.setVolume(58); // set the value of the volume to your liking.
s.start(0,999);
Knob Layer:
------------
onClipEvent(load)
{
// maximum angle of rotation for the knob
maxRotAngle = 150;
// read the initial volume & set the position of the knob
this.rotbutton._rotation = (2*_root.s.getVolume() - 100)*maxRotAngle/100;
//read the initial pan and set the position of the knob
this.rotbutton._rotation = _root.s.getPan() * maxRotAngle/100;
}
// set the volume depending on the position of the knob
//use forumla to convert _rotation into volume or pan range
onClipEvent(enterFrame)
{
if (rotbutton.dorotate)
{
_root.s.setVolume(Math.floor((100
+this.rotbutton._rotation/maxRotAngle*100)/2));
//_root.s.setPan(Math.floor((this.rotbutton._rotatio n/maxRotAngle*
100)));
}
//update readouts...
_root.sovolume = _root.s.getVolume();
_root.dialangle = this.rotbutton._rotation;
}
Segun fui entendiendo hice lo siguiente:
Crear un nuevo proyecto, añadi dos capas, una para el control y otra para el sonido.
en la del sonido pegue esta parte del codigo:
Código PHP :
s = new Sound(this); s.setVolume(58); // set the value of the volume to your liking. s.start(0,999);
Y en la otra pegue el resto.
Espero que alguien tenga la paciencia de poder ayudarme y entienda que recien estoi comenzando .
Gracias a todos
