PDA

View Full Version : spin a wheel?


martoons
01-30-2003, 07:19 PM
I am not a coder, and I have no idea how to do this. Can someone tell me how to do this?
I am trying to set up a 'wheel of fortune' type of thing, except I don't want the user to spin the wheel around, I want the user to move the wheel around by dragging it to the appropriate postion along the radius.
Almost like an old rotary phone except the wheel will stay where it is 'spun' to.

Can someone help me with this?

martoons

annexion
01-30-2003, 09:53 PM
This should point you in the right direction.

martoons
01-31-2003, 01:46 PM
That was exactly what I was thinking of, Thanks you so much.

m

prinsesa
02-18-2004, 04:06 AM
helo guys.
i know this thread about the wheel is kinda old but i'm facing a big dilemna as well today.
i need help since i'm new in scripting and i need to solve this project

how can i do a spin wheel with 6 slices and when its stop at the pointer it will show the value of the slice in a rectangular text box?

i have drawn the wheel already but how can i randomly rotate it and pass the value of the slice

if there any existing thread on this, i will also appreciate it

thanks a lot for the rescue

prinsesa
02-18-2004, 09:01 PM
i need to do a project similar to this one i found

http://www.quickcompliance.net/qcsamples/Privacy101Audio/html/L9/index.html?001.html


if there's any existing tutorial about this let me know asap

thanks a million

binkyboo
02-20-2004, 02:30 PM
This should help you get started!

function spinWheel() {
// gives rotational speed between 20 and 70
w = Math.random()*50+20;
arrowMC.onEnterFrame = function() {
if (w>0) {
this._rotation += w--;
} else {
if (this._rotation>=0 && this._rotation<=180) {
degrees = Math.round(arrowMC._rotation);
trace(degrees);
} else {
degrees = Math.round(180-(Math.abs(this._rotation)))+180;
trace(degrees);
}
arrowMC.onEnterFrame = null;
w = 0;
}
};
}
_root.btn_spin.onRelease = function() {
spinWheel();
};

prinsesa
02-22-2004, 07:38 PM
thanks for this!
where shall i put this script? is it in the wheel?

prinsesa
02-22-2004, 08:14 PM
binkyboo

i've copied your script and i made something like this.
pls see if this is correct?


the problem is i dont know how to display the value of the slice since it just displays the degrees. whats the reference point of the angle? where is the 0 degrees?

thanks again!

prinsesa
02-22-2004, 08:24 PM
hey, how do i attach the file ??

binkyboo
02-23-2004, 08:04 AM
zero degrees would be twelve o'clock.

binkyboo
02-23-2004, 08:12 AM
Here's an example.