我正在尝试向舞台添加一个符号,但我遇到了参数错误。
我的代码:
symHolder.mc.sym01_mc.addEventListener(MouseEvent.MOUSE_DOWN, startDragHandler);
function startDragHandler(event:MouseEvent):void {
var ClassReference:Class = getDefinitionByName("Sym" + event.target.name.charAt(3) + event.target.name.charAt(4)) as Class;
var s:MovieClip = (new ClassReference("s" + num) as MovieClip);
s.x = mouseX;
s.y = mouseY;
toggleSymHolder(null);
addChild(s);
s.name = "s" + num;
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragHandler);
s.startDrag();
s.addEventListener(MouseEvent.MOUSE_DOWN, nextDrag);
num ++;
}