[color=#669900]the script for the ball in my sig, i was not the original creator of the ball script although i learnt from it and tweaked it, so this should not be used for commercial use. That said here is the script for the ball in my sig.create a circle and give it this script
QUOTE(circle script)
on (press) {
startDragUnlocked();
dragging = true;
}
on (release,releaseOutside) {
stopDrag();
dragging = false;
}
then group the circle as a sprite and give the sprite this script
QUOTE(sprite script)
onFrame (1) {
_x=0;
_y=0;
xspeed=Math.random()*60-30;
yspeed=Math.random()*60-30;
rightedge=300;
leftedge=0;
topedge=0;
bottomedge=40;
gravity=1;
drag=.98;
bounce=.9;
}
onFrame (2) {
if (!dragging) {
_x = _x+xspeed;
if (_x+_width/2>rightedge) {
_x = rightedge-_width/2;
xspeed = -xspeed*bounce;
}
if (_x-_width/2_x = leftedge+_width/2;
xspeed = -xspeed*bounce;
}
_y = _y+yspeed;
if (_y+_height/2>bottomedge) {
_y = bottomedge-_height/2;
yspeed = -yspeed*bounce;
}
if (_y-_height/2 _y = topedge+_height/2;
yspeed = -yspeed*bounce;
}
yspeed = yspeed*drag+gravity;
xspeed = xspeed*drag;
} else {
xspeed=_x-oldx;
yspeed=_y-oldy;
oldx=_x;
oldy=_y;
}
}
onFrame (3) {
gotoAndPlay(2);
}