Aug 1, 2003 #1 martinb7 Programmer Jan 5, 2003 235 GB Hi, how do you make a movie clip rotate using actionscript? e.g A speed dial: when the speed increases, how would you make the pointer turn to point to the the numbers around the side matching the speed in a dynamic text box?? Any ideas? Thanx Martin
Hi, how do you make a movie clip rotate using actionscript? e.g A speed dial: when the speed increases, how would you make the pointer turn to point to the the numbers around the side matching the speed in a dynamic text box?? Any ideas? Thanx Martin
Aug 1, 2003 #2 wangbar Programmer Jul 23, 2001 1,906 GB Rotation works in degrees so this will rotate a clip 10 degrees clockwise: myMovieClip._rotation+=10 To make it line up with a dial or display just work out how far round the dial you need it to go in degrees and add the value on. Upvote 0 Downvote
Rotation works in degrees so this will rotate a clip 10 degrees clockwise: myMovieClip._rotation+=10 To make it line up with a dial or display just work out how far round the dial you need it to go in degrees and add the value on.
Aug 1, 2003 Thread starter #3 martinb7 Programmer Jan 5, 2003 235 GB yes, but how do you match the rotation to the numbers on the speedometer if the value is coming from a text box?? Upvote 0 Downvote
yes, but how do you match the rotation to the numbers on the speedometer if the value is coming from a text box??
Aug 1, 2003 #4 wangbar Programmer Jul 23, 2001 1,906 GB You just have to work out where the numbers lie on the circumference of the circle in relation to the value you have is the textbox. For instance - you have numbers 1 to 10 as he values that may appear in the textbox and ten points around the circle that forms your readout. 360 degrees in a circle so to go to the right value on the dial you'd have this code: meter._rotation=myTextBoxValue*(360/10) If it's a constant readout you'd have to put the whole thing into a frame by frame event: this.onEnterFrame=function(){ meter._rotation=myTextBoxValue*(360/10) } Upvote 0 Downvote
You just have to work out where the numbers lie on the circumference of the circle in relation to the value you have is the textbox. For instance - you have numbers 1 to 10 as he values that may appear in the textbox and ten points around the circle that forms your readout. 360 degrees in a circle so to go to the right value on the dial you'd have this code: meter._rotation=myTextBoxValue*(360/10) If it's a constant readout you'd have to put the whole thing into a frame by frame event: this.onEnterFrame=function(){ meter._rotation=myTextBoxValue*(360/10) }