Alright, everyone here knows my coding isn’t exactly that efficient, I am a very sloppy coder, but here goes the code…
[AS]MovieClip.prototype.drawSquare = function(r, x, y) {
this.lineStyle(.25, 0x000000, 50);
this.beginFill(0xE6E6E6, 50);
this.moveTo(-r, -r);
this.lineTo(r, -r);
this.lineTo(r, r);
this.lineTo(-r, r);
this.lineTo(-r, -r);
this.endFill();
this._x = x;
this._y = y;
};
MovieClip.prototype.drawSliderLine = function() {
this.lineStyle(1, 0x000000, 50);
this.moveTo(0, 0);
this.lineTo(100, 0);
};
MovieClip.prototype.drawCircle = function(x, y, r, lineThickness, RGB, alpha, xpos, ypos) {
var c1 = r*(Math.SQRT2-1);
var c2 = rMath.SQRT2/2;
this.lineStyle(lineThickness, RGB[0], alpha[0]);
this.beginFill(RGB[1], alpha[1]);
this.moveTo(x+r, y);
this.curveTo(x+r, y+c1, x+c2, y+c2);
this.curveTo(x+c1, y+r, x, y+r);
this.curveTo(x-c1, y+r, x-c2, y+c2);
this.curveTo(x-r, y+c1, x-r, y);
this.curveTo(x-r, y-c1, x-c2, y-c2);
this.curveTo(x-c1, y-r, x, y-r);
this.curveTo(x+c1, y-r, x+c2, y-c2);
this.curveTo(x+r, y-c1, x+r, y);
this.endFill();
this._x = xpos;
this._y = ypos;
};
MovieClip.prototype.createSlider = function(x, y, startPos, effectVar) {
this.createEmptyMovieClip(“sliderLine”, -10).drawSliderLine();
this.createEmptyMovieClip(“slider”, -9).drawSquare(5, startPos, 0);
this.slider.onPress = function() {
this.startDrag(true, 0, 0, 100, 0);
this.onMouseMove = function() {
this._parent.sliderLabel.text = Math.round(this._x);
this._parent.sliderLabel.setTextFormat(myFormat);
if (effectVar == “affectArea”) {
affectArea = Math.round(this._x);
} else if (effectVar == “pushDist”) {
pushDist = Math.round(this._x);
}
};
};
this.slider.onRelease = this.slider.onReleaseOutside=stopDrag;
this.createTextField(“sliderLabel”, -6, 110, -8, 100, 16);
this.sliderLabel.text = startPos;
this.sliderLabel.selectable = false;
this.sliderLabel.setTextFormat(myFormat);
this._x = x;
this._y = y;
};
MovieClip.prototype.jumper = function() {
this.startX = this._x;
this.startY = this._y;
this._xscale = this._yscale=this._alpha=15;
this.onMouseMove = function() {
if (this._parent.hitBlock.hitTest(this._parent._xmouse, this._parent._ymouse, true)) {
this._x = this.startX;
this._y = this.startY;
this.dx = this._x-this._parent._xmouse;
this.dy = this._y-this._parent._ymouse;
this.hyp = Math.sqrt(this.dxthis.dx+this.dythis.dy);
if (this.hyp<affectArea) {
this.strength = Math.pow((affectArea-this.hyp)/affectArea, 3);
this._x += pushDistthis.strengththis.dx/this.hyp;
this._y += pushDistthis.strengththis.dy/this.hyp;
this._xscale = this._yscale=this._alpha=15+100this.strength;
} else {
this._xscale = this._yscale=this._alpha=15;
}
} else {
this._x += (this.startX-this._x)/5;
this._y += (this.startY-this._y)/5;
this._xscale = this._yscale=this._alpha += (15-this._xscale)/5;
}
};
};
myFormat = new TextFormat();
myFormat.font = “Verdana”;
myFormat.size = 10;
var maxClips = 95;
var affectArea = 50;
var pushDist = 25;
this.createEmptyMovieClip(“hitBlock”, -10).drawSquare(99, 100, 100);
this.createEmptyMovieClip(“slider1”, -100).createSlider(55, 220, 50, “affectArea”);
this.createEmptyMovieClip(“slider2”, -99).createSlider(55, 240, 25, “pushDist”);
this.createEmptyMovieClip(“circle”, -7).drawCircle(0, 0, 20, 5, [0x000000, 0xFFFFFF], [100, 0], 10, 10);
this.createTextField(“slider1Label”, -1000, 10, slider1._y-18, 500, 16);
slider1Label.text=“Affected Area”, slider1Label.selectable=false, slider1Label.setTextFormat(myFormat);
this.createTextField(“slider2Label”, -2000, 10, slider2._y-18, 500, 16);
slider2Label.text=“Push Distance”, slider2Label.selectable=false, slider2Label.setTextFormat(myFormat);
circle._visible = false;
for (var i = 0; i<maxClips; i++) {
mc = circle.duplicateMovieClip(“circle”+i, i);
mc.createEmptyMovieClip(“center”, 1).drawCircle(0, 0, 10, 0, [0x000000, 0x666666], [0, 100], 0, 0);
mc._x = (i*20)+20;
while (mc._x>=200) {
mc._x -= 190;
mc._y += 20;
}
mc.jumper();
}[/AS]