Animating an arrow on a wheel to stop at 3 links

there are only 3 links on my wheel, I want it to randomly stop at any

Page 1 of 1

0 Replies - 974 Views - Last Post: 22 September 2009 - 09:05 PM

#1 amaray   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-September 09

Animating an arrow on a wheel to stop at 3 links

Post icon  Posted 22 September 2009 - 09:05 PM

On my main page I want to have a wheel ( like a wheel of fortune wheel, except an arrow is spinning on it rather than the wheel spinning) spin and randomly stop at 3 different links and go to the page that it lands on. I only have 3 links on the wheel but it has 8 different landing points. I don't want the arrow to land on the other 5 spaces, just one of the 3 links.

I am able to get the wheel to spin, and stop spinning but I can't get it to land just on 3 different points and go to that link ( if the go to is even possible, I don't know) I have put in code to try to stop the wheel at the 3 points, but it won't stop, or take me to any of these links.

var step:Number = 15;					
var tm:Timer = new Timer(10);

tm.addEventListener(TimerEvent.TIMER, spin);

function spin(tevt:TimerEvent):void {
	mcArrow.rotation += step;
}

btnSpin.addEventListener(MouseEvent.CLICK, startSpin);

function startSpin(mevt:MouseEvent):void {
	btnStop.addEventListener(MouseEvent.CLICK, stopSpin);
	btnSpin.removeEventListener(MouseEvent.CLICK, startSpin);
	tm.start();
}

function stopSpin(mevt:MouseEvent):void {
	tm.stop();
	btnSpin.addEventListener(MouseEvent.CLICK, startSpin);
	btnStop.removeEventListener(MouseEvent.CLICK, stopSpin);
		portfolio_main.addEventListener 
	   (MouseEvent.CLICK, clickportfolio_main);
function clickportfolio_main (event:Event) :void {
	gotoAndStop("Portfolio");
}
	mcArrow.rotation = 30*Math.round(mcArrow.rotation/30);
}

 


Is This A Good Question/Topic? 0
  • +

Page 1 of 1