Hi there, I am programming a drag and drop using a instance array. The problem I am having is that the instances have dynamic text within them. I am trying to track what symbol the user clicked so that I can drag that instance. Well... sometimes, the program registers the button name, and sometimes it registers the text within the button. Is there a clean way to prevent this from happening?
Any help you can provide is appreciated! Thanks! Susan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var aButtons:Array = new Array(b0, b1, b2, b3); aButtons[0].txDrag.text= "Drag 1"; aButtons[1].txDrag.text= "Drag 2"; aButtons[2].txDrag.text= "Drag 3"; aButtons[3].txDrag.text= "Drag 4"; //var _rectangle:Sprite; var i:Number; for (i= 0; i < aButtons.length; i++) { aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN, startDragging); aButtons[i].addEventListener(MouseEvent.MOUSE_UP, stopDragging); } function startDragging(event:MouseEvent):void { var count:Number = aButtons.length; var index:Number; trace(event.target.name) for (i = 0; i < count; i++) { if (evt.target.name == aButtons[i].name ) { //drag code to be added... aButtons[i].startDrag(); } _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders