Hello!
I’m trying to do a “drag and drop” with an array, but i can only move everything at the same time, and i’ll like to move each element of the array separately.
this is my code, and i have a movieclip in the library with export for actionscript(Rect) :
/////////
var arr:Array = new Array();
for (var i:int = 0; i < 6; i++) {
var a:Rect = new Rect();
arr.push(a);
addChild(a);
a.x+=i20;
a.y+=i30;
}
stage.addEventListener(MouseEvent.MOUSE_DOWN, drag);
stage.addEventListener(MouseEvent.MOUSE_UP, drop);
function drag(event:MouseEvent):void{
this.startDrag();
this.parent.addChild(this);
}
function drop(event:MouseEvent):void{
this.stopDrag();
}
//////////
thanks for all kind of help.
cheers.