5,462 Forum Posts by "API"
put this script in a seperate layer, then, in another layer, put a movie clip named ball_mc.
var centerX = 275;
var centerY = 200;
var k = .2;
ball_mc.onPress = function() {
this.startDrag();
this.dragging = true;
};
ball_mc.onRelease = ball_mc.onReleaseOutside=function () {
this.stopDrag();
this.dragging = false;
};
onEnterFrame = function () {
if (!ball_mc.dragging) {
dx = centerX-ball_mc._x;
dy = centerY-ball_mc._y;
accX = dx*k;
accY = dy*k;
velX += accX;
velY += accY;
velX *= .9;
velY *= .9;
ball_mc._x += velX;
ball_mc._y += velY;
} else {
velX = ball_mc._x-oldX;
velY = ball_mc._y-oldY;
oldX = ball_mc._x;
oldY = ball_mc._y;
}
clear();
lineStyle(1, 0, 100);
moveTo(centerX, centerY);
lineTo(ball_mc._x, ball_mc._y);
};
Man, that really sucks! i have had similar experiences....
when i was little, my friends and i went out to kick a soccer ball around. there was a 17 year old there, around the goal. i didnt see him until i accidentally kicked the ball in his nuts. :p. he had a younger kid with him, and the 17 year old yelled: "KILL HIM!"
so, natuarally, i ran like hell. the kid caught up and started kicking me. i was in shock, so i felt no pain! i saw the same 17 year old kid at the video game store and he appologized. "i forgive you, but my nuts wont...

