Hi Note my code below
this.addEventListener(Event.ENTER_FRAME,follow);
function follow(evt:Event):void {
addChild(mouseThing_mc);
var xMouse:Number=(stage.mouseX);
var yMouse:Number=(stage.mouseY);
var xH:Number=mouseThing_mc.x;
var yH:Number=mouseThing_mc.y;
mouseThing_mc.x=xMouse;
mouseThing_mc.y=yMouse;
}
// SOME OTHER STUFF HAPPENS IN HERE AND FINALLY
var menuItem11:ContextMenuItem=new ContextMenuItem("Home");
menuItem11.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, home1);
function home1(event:ContextMenuEvent):void {
this.removeEventListener(Event.ENTER_FRAME,follow);
MovieClip(root).gotoAndPlay("out_point2");
}
So when I navigate out of this movieclip once the function home1 is fired, I get the following error
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at home_fla::mc_content_13/follow()
I know it is the function looking for that mouseThing_mc that is not there. Any ideas?