# How spin the wheel on movie load without mouse click

**URL:** https://forum.kirupa.com/t/how-spin-the-wheel-on-movie-load-without-mouse-click/327072
**Category:** Uncategorized
**Created:** [February 4, 2012, 1:33am UTC](https://forum.kirupa.com/t/how-spin-the-wheel-on-movie-load-without-mouse-click/327072 "2012-02-04T01:33:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![aruna\_juice](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@aruna\_juice](https://forum.kirupa.com/u/aruna_juice)
#### Post date: [February 4, 2012, 1:33am UTC](https://forum.kirupa.com/t/how-spin-the-wheel-on-movie-load-without-mouse-click/327072/1 "2012-02-04T01:33:26Z")

</div>

[COLOR=#333333][FONT=Segoe UI]Hello all, I am new to flash and seem to be stuck with this problem. Any guidance would be extremely appreciated.

I am trying to spin the wheel automatically with out mouse click. i am trying harder. here is the code:

[/FONT][/COLOR][COLOR=#333333][FONT=Segoe UI]

```auto
[/FONT][/COLOR]
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;

txtCount.background=true;

var randomnumber:Number; 

var tw:Tween = new Tween(mcArrow,"rotation",Strong.easeOut, 10, 360, 20, true); 

tw.stop();

tw.addEventListener(TweenEvent.MOTION_FINISH, spinStopped);

function spinStopped(twevt:TweenEvent):void {
	txtCount.backgroundColor = 0xFFFFFF;
	txtCount.text = String(randomnumber);
	mcArrow.addEventListener(MouseEvent.CLICK, spin);
}

mcArrow.addEventListener(MouseEvent.CLICK, spin);

function spin(mevt:MouseEvent):void {
	var numturns:int = Math.ceil(2*Math.random());
	randomnumber = Math.ceil(100*Math.random());
	
	mcArrow.removeEventListener(MouseEvent.CLICK, spin);
	
	txtCount.text = "Spinning...";
	txtCount.backgroundColor = 0xFF9999;
	
	tw.begin = mcArrow.rotation;
	tw.finish = numturns*1080 + randomnumber*3.6;
	tw.start();
}
[COLOR=#333333][FONT=Segoe UI]

```

here is the sample file [/FONT][/COLOR][http://www.mediafire.com/?q988b9nse43zbdg[COLOR=#333333]](http://www.mediafire.com/?q988b9nse43zbdg%5BCOLOR=#333333%5D)[FONT=Segoe UI]  
how to get the specified number which is available in mysql database instead of random no.

advance thanks for the help…[/FONT][/COLOR]
