0
나는 라이브러리에 심볼을 가지고 있으며, 스테이지에는 심볼릭 오브젝트가 12 개 있습니다. I 열두 개체 (화상) 인스턴스 이름이 또한 as3에서 문자열을 인스턴스 이름으로 변환하는 방법
알
에서 각 기호 I는 I 추출 할 수있는 화상의 객체 중 하나를 클릭 1-12로부터하는 인스턴스 명을 이름 개체 (al) 배열에서 있지만 액세스 할 수 없습니다. 내가 추적 승리
var abc:Array = ["0","a","b","c","d","e","f","g","h","i","j","k","l"];
function item_onMouseUp(event:MouseEvent):void
{
var clip:Sprite = Sprite(event.currentTarget);
var c:int = int(clip.name);
trace("abc[c]=" +[abc[c]]);
//The problem here
if (clip.hitTestObject([abc[c]]))
{
trace("===");
}
clip.stopDrag();
}
예에 AS3에서 인스턴스 이름 문자열을 변환 할 수있는 방법
는 나는 당신의 이름이 표시입니다 (객체의 속성을 해결하기 위해
abc[c]=d
TypeError: Error #1034: Type Coercion failed: cannot convert "d" to flash.display.DisplayObject.
at gamewitoutserver_fla::MainTimeline/item_onMouseUp()