You can edit this to fit your needs possibly. Its something similar to what you need.
w = 13;
h = 10;
gw = 550 / (w - 1);
d = .7;
k = .15;
sd = 50;
showgrid = true;
dd = 0;
createEmptyMovieClip("pointHold",2);
for (i = 1; i <= h; i++) {
for (j = 1; j <= w; j++) {
mc = pointHold.createEmptyMovieClip("p_" + i + "_" + j, ++dd);
mc._x = mc.ox = Stage.width / 2 - (w - 1) * gw / 2 + gw * (j - 1);
mc._y = mc.oy = Stage.height / 2 - (h - 1) * gw / 2 + gw * (i - 1);
mc.onEnterFrame = main;
}
}
pointHold.onEnterFrame = function() {
clear();
lineStyle(.25,0xffffff,40);
for (i = 1; i <= h; i++) {
mc = _root.pointHold["p_" + i + "_" + "1"];
moveTo(mc._x,mc._y);
for (j = 2; j <= w; j++) {
mc = _root.pointHold["p_" + i + "_" + j];
lineStyle(.25,0xffffff,40);
lineTo(mc._x,mc._y);
}
}
for (i = 1; i <= w; i++) {
mc = _root.pointHold["p_" + "1" + "_" + i];
moveTo(mc._x,mc._y);
for (j = 2; j <= h; j++) {
mc = _root.pointHold["p_" + j + "_" + i];
lineStyle(.25,0xffffff,40);
lineTo(mc._x,mc._y);
}
}
};
function main() {
if (this.vx == undefined) {
this.vx = 0;
this.vy = 0;
}
this.vx += (this.ox - this._x) * k;
this.vy += (this.oy - this._y) * k;
var dx = this._x - _root._xmouse;
var dy = this._y - _root._ymouse;
var dist = Math.sqrt(dx * dx + dy * dy);
if (dist <= sd) {
var a = Math.atan2(dy, dx);
this.vx += (_root._xmouse + sd * Math.cos(a) - this._x) * k;
this.vy += (_root._ymouse + sd * Math.sin(a) - this._y) * k;
}
this._x += (this.vx *= d);
this._y += (this.vy *= d);
}