Hello Embussy, to have different buttons spining the wheel, I have divided up the code, so you have two functions, over() and out(), check it out below. I have also included an fla attachment with a working example of two buttons calling the same wheel to spin. I put some variables for you to play around with, increase speed etc.
This is a very simple and quick code, will work for small projects, but cannot be used to launch a rocket or anything like that.lol enjoy, hope it helps :
Code:
var startspeed = 30;
var maxSpeed = 60;
var halt = 0;
var accelerateBy = 1; //this will speed up speed up spinning as you increase
var applyBrakeBy = 1; //play around with this to increase breaking
btn1.onRollOver = over;
btn1.onRollOut = out;
btn2.onRollOver = over;
btn2.onRollOut = out;
function over()
{
onEnterFrame = function()
{
startspeed += accelerateBy;
wheel_mc._rotation += startspeed;
if(startspeed >= maxSpeed)
{
startspeed = maxSpeed;
}
}
}
function out()
{
onEnterFrame = function()
{
startspeed -= applyBrakeBy;
wheel_mc._rotation += startspeed;
if(startspeed <= halt)
{
startspeed = halt;
delete this.onEnterFrame;
}
}
}