post insane actionscript here!
- API
-
API
- Member since: Oct. 13, 2003
- Offline.
-
- Forum Stats
- Member
- Level 22
- Blank Slate
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);
};
- calculon000
-
calculon000
- Member since: Jun. 19, 2003
- Offline.
-
- Forum Stats
- Member
- Level 19
- Voice Actor
I think I did it wrong...
I tried it and all I got was a diagonal line and the ball_mc movie clip just sittin there.
- API
-
API
- Member since: Oct. 13, 2003
- Offline.
-
- Forum Stats
- Member
- Level 22
- Blank Slate
im sorry, when i posted the script, it didnt format right.... im so sorry! its not a scripting error.

