I’m going to fix the controls later, but for right now you would just hold the button and click on the MC.
I also need a better idea of how to organize a 1000 MC’s.
Here is the swf:
http://img98.imageshack.us/my.php?image=attachmovie3yo7.swf
Here is the AS:
thing.onPress = function() {
funcName(circle,"circle","circle1",-8,11.6);
};
thing2.onPress = function() {
funcName(square,"square","square1",142,11.6);
};
thing3.onPress = function() {
funcName(triangle,"triangle","triangle 1",352,11.6);
};
thing4.onPress = function() {
funcName(rectangle,"rectangle"," rectangle1",472,11.6);
};
thing5.onPress = function() {
funcName(ovel,"ovel"," ovel1",572,11.6);
};
speed = 1;
speed2 = 10;
function funcName(mcUse:MovieClip, exportName:String, newName:String, xLoc:Number, yLoc:Number):Void {
var mcUse:MovieClip = attachMovie(exportName, newName, _root.getNextHighestDepth(), {_x:xLoc, _y:yLoc});
mcUse.onPress = function() {
mcUse.startDrag();
};
mcUse.startDrag();
mcUse.getNextHighestDepth();
mcUse.onMouseUp = function() {
delete mcUse.onMouseUp;
mcUse.stopDrag();
mcUse.onRelease = function() {
mcUse.stopDrag();
mcUse._x += Key.isDown(76)*speed;
mcUse._x -= Key.isDown(74)*speed;
mcUse._y += Key.isDown(75)*speed;
mcUse._y -= Key.isDown(73)*speed;
if (Key.isDown(70)) {
mcUse._yscale = -this._yscale;
}
if (Key.isDown(71)) {
mcUse._xscale = -this._xscale;
}
if (Key.isDown(82)) {
mcUse._rotation += 1;
}
if (Key.isDown(69)) {
mcUse._rotation -= 1;
}
mcUse._x += Key.isDown(Key.RIGHT)*speed2;
mcUse._x -= Key.isDown(Key.LEFT)*speed2;
mcUse._y += Key.isDown(Key.DOWN)*speed2;
mcUse._y -= Key.isDown(Key.UP)*speed2;
if (Key.isDown(90)) {
mcUse._alpha -= 5;
}
if (Key.isDown(88)) {
mcUse._alpha += 5;
}
if (Key.isDown(81)) {
mcUse.swapDepths(this.getDepth()-1);
}
if (Key.isDown(87)) {
mcUse.swapDepths(this.getDepth()+1);
}
if (Key.isDown(83)) {
mcUse._xscale += 2;
mcUse._yscale += 2;
}
if (Key.isDown(65)) {
mcUse._xscale -= 2;
mcUse._yscale -= 2;
}
if (Key.isDown(67)) {
mcUse._xscale -= 2;
}
if (Key.isDown(86)) {
mcUse._xscale += 2;
}
if (Key.isDown(66)) {
mcUse._yscale -= 2;
}
if (Key.isDown(78)) {
mcUse._yscale += 2;
}
if (Key.isDown(65)) {
mcUse._xscale -= 2;
mcUse._yscale -= 2;
}
if (Key.isDown(68)) {
mcUse.removeMovieClip();
}
if (Key.isDown(77)) {
mcUse._y = random(400);
mcUse._x = random(550);
mcUse._xscale = random(200);
_yscale = random(200);
mcUse._alpha = random(100);
mcUse._rotation = random(360);
}
if (Key.isDown(80)) {
var Print = new PrintJob();
var myResult = Print.start();
if (myResult) {
myResult = Print.addPage(0, {xMin:0, xMax:400, yMin:0, yMax:400});
myResult = Print.addPage("sel", {xMin:0, xMax:400, yMin:400, yMax:800}, {printAsBitmap:true}, 1);
myResult = Print.addPage(1, null, {printAsBitmap:false}, 2);
myResult = Print.addPage(0);
Print.send();
}
delete Print;
}
};
};
}