Adding Sound to A Spinner (Wheel of Fortune)
So I have the following script for my wheel of fortune spinner. Works fine but I'd like to add "clicking" sound. What do I need to add to script to make it work?
onClipEvent (load) {
wx = getProperty("",_x);
wy = getProperty("",_y);
Mouse = "up";
}
onClipEvent (mouseUp) {
Mouse = "up";
../rotater:go = "yes";
../rotater:w = w;
}
onClipEvent (mouseDown) {
../rotater:go = no;
Mouse = "down";
current_rotation = getProperty("",_rotation);
if (mouse eq "down")
{
mx = getProperty("_level0",_xmouse);
my = getProperty("_level0",_ymouse);
slope = (my-wy)/(mx-wx);
theta = Math.atan (slope)*(180/Math.PI);
if (mx > wx and my < wy)
{
ang = current_rotation-theta;
}
else if (mx < wx and my < wy)
{
ang = current_rotation-(180-theta)*-1;
}
else if (mx < wx and my > wy)
{
ang = current_rotation-180+theta;
}
else if (mx > wx and my > wy)
{
ang = current_rotation-(360-theta)*-1;
}
_level0:theta = theta;
_level0:ang = ang;
}
}
onClipEvent (mouseMove) {
if (mouse eq "down")
{
rot2 = rot1;
rot1 = getProperty("",_rotation);
w = (rot1-rot2)*5;
mx = getProperty("_level0",_xmouse);
my = getProperty("_level0",_ymouse);
slope = (my-wy)/(mx-wx);
theta = Math.atan (slope)*(180/Math.PI);
if (mx > wx and my < wy)
{
setProperty("", _rotation, theta+ang);
}
else if (mx < wx and my < wy)
{
setProperty("", _rotation, (180-theta)*-1+ang);
}
else if (mx < wx and my > wy)
{
setProperty("", _rotation, 180+theta+ang);
}
else if (mx > wx and my > wy)
{
setProperty("", _rotation, (360-theta)*-1+ang);
}
setProperty("", _xscale, 100);
setProperty("", _yscale, 100);
_level0:theta = theta;
_level0:ang = ang;
}
Last edited by clydezjr; 05-23-2012 at 10:13 PM.
|