I have a simple loop that duplicates a movieclip. I have 2 frames within this mc and I am trying to play frame 2 when mouse roll over. I am trying to add a mouse_over listener and keep receiving an error: brief account of my code is:
for (var i:Number=0; i<10; i++)
{
var item:NewItem = new NewItem();
item.name = "item" + i;
MainItem.addChild(item);
item.x = xPos;
xPos += (70*2 + 15);
item.button.addEventListener(MouseEvent.MOUSE_OVER, controlOver);
}
function controlOver(e:MouseEvent):void
{
MovieClip(parent).gotoAndStop(2);
}
when I try and rollover the item I receive:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@36ccd089 to flash.display.MovieClip.at forloopas3_fla::MainTimeline/controlOver()
How can I get this working for me?
Thanks
Eddie