# Any one help me

**URL:** https://forum.kirupa.com/t/any-one-help-me/309796
**Category:** Uncategorized
**Created:** [May 25, 2010, 5:36am UTC](https://forum.kirupa.com/t/any-one-help-me/309796 "2010-05-25T05:36:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nayana](https://avatars.discourse-cdn.com/v4/letter/n/8baadc/32.png) [@nayana](https://forum.kirupa.com/u/nayana)
#### Post date: [May 25, 2010, 5:36am UTC](https://forum.kirupa.com/t/any-one-help-me/309796/1 "2010-05-25T05:36:30Z")

</div>

\<div class=“jive-rendered-content”\>Hi,

I want to stop ball depending on the speed.  
when i will set the ball speed that time i want to move this ball on this speed.

Here is my code…

var speed:Number = 0;  
var intervalIDLine:Number;  
right\_btn.onPress = function() {  
if (arrow\_mc.\_rotation\<0) {  
arrow\_mc.\_rotation = arrow\_mc.\_rotation+5;  
}  
intervalIDLine = setInterval(setAngleRight, 200);  
};  
right\_btn.onRelease = function() {  
clearInterval(intervalIDLine);  
};  
function setAngleRight() {  
if (arrow\_mc.\_rotation\<0) {  
arrow\_mc.\_rotation = arrow\_mc.\_rotation+5;  
}  
}  
var intervalLeftID:Number;  
left\_btn.onPress = function() {  
if (arrow\_mc.\_rotation\>=-172.094131469727) {  
arrow\_mc.\_rotation = arrow\_mc.\_rotation-5;  
}  
intervalLeftID = setInterval(setAngleLeft, 200);  
};  
left\_btn.onRelease = function() {  
clearInterval(intervalLeftID);  
};  
function setAngleLeft() {  
if (arrow\_mc.\_rotation\>=-172.094131469727) {  
arrow\_mc.\_rotation = arrow\_mc.\_rotation-5;  
}  
}  
function onEnterFrame() {

\<span style=“color: rgb(0, 0, 255);”\>for (i in balls) {  
ball = balls\*;  
ball.\_x += Math.cos(ball.\_rotation\*Math.PI/180)_speed;  
ball.\_y += Math.sin(ball.\_rotation_Math.PI/180)\*speed;  
ball.\_xscale -= 5.1;  
ball.\_yscale -= 5.1;  
if (ball.\_y\<100 && \_global.golerAni == false) {  
goler\_mc.gotoAndPlay(“f3”);  
\_global.golerAni = true;  
}  
if (ball.\_x\<0 || ball.\_x\>Stage.width || ball.\_y\<=0 || ball.\_y\>Stage.height) {  
&nbs
