Hi there,
First time I’m having this error, I’ve created different MC in a for loop in a public function.
Then I need to access these MC for mouseOver / mouseOut functions, and I get this error 1006. I guess I have something undefined or a problem with Array but I can’t see what I’m doing wrong.
Here is my code so far :
for (var i:int = 0; i <linkNames.length; i++) {
var link:MovieClip = new MovieClip();
link.graphics.drawRect(0, 0, 130, 30);
link.id = i;
link.x = linkXPos;
lkArray.push([link]);
textMenu.addChild(link);
link.mouseEnabled = true;
link.mouseChildren = false;
link.buttonMode = true;
link.addEventListener(MouseEvent.MOUSE_DOWN, dischargeContent);
link.addEventListener(MouseEvent.MOUSE_OVER, functionOver, false, 0, true);
link.addEventListener(MouseEvent.MOUSE_OUT, functionOut, false, 0, true);
var lk:TextField = new TextField();
lk.autoSize = TextFieldAutoSize.LEFT;
lk.antiAliasType = AntiAliasType.ADVANCED;
lk.defaultTextFormat = textFormat1;
lk.embedFonts = true;
lk.text = linkNames*;
lk.alpha = 0;
link.addChild(lk);
linkXPos = linkXPos + lk.width + 10;
Tweener.addTween(lk, {alpha:1, time:0.25, delay:i/5, transition:"EaseInExpo"});
}
The problem occurs when I’m doing this in another public function
lkArray[0].removeEventListener(MouseEvent.MOUSE_OVER, functionOver);
Many thanks, I’m stuck