Any one help me

<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