Las funciones con problema son: onTouchBegin1 y onTouchEnd1
Este es mi código:
Código ActionScript :
var mcs:Array = new Array(a1,a2,a3,a4,a5); for(var m = 0; m < mcs.length; m++) { mcs[m].addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin1); mcs[m].addEventListener(TouchEvent.TOUCH_END, onTouchEnd1); } function onTouchBegin1(event:TouchEvent) { this.addChild(event.target as DisplayObject); event.target.startTouchDrag(event.touchPointID); } function onTouchEnd1(event:TouchEvent) { var zona:String = ""; var mc:int; try{ event.target.stopTouchDrag(event.touchPointID); soundDrop.play(); zona = event.currentTarget.dropTarget.parent.name; mc = int(event.currentTarget.name.substr(1,1)); } catch(e:Error) { trace("SE CAE "+e); } if (zona!="dZone") { resp = 0; event.currentTarget.x = event.currentTarget.startX; event.currentTarget.y = event.currentTarget.startY; } else { event.currentTarget.x = event.currentTarget.dropTarget.parent.x; event.currentTarget.y = event.currentTarget.dropTarget.parent.y; switch (mc) { case 1 : resp = 1 break; case 2 : resp = 2 break; case 3 : resp = 3 break; case 4 : resp = 4 break; case 5 : resp = 5 break; } } }