AS3 null object error on movie clip 1009 cannot access

Hello I was wandering if someone could help, I keep getting this error spat back at me when I try to launch something in as3. Do I need to import something? Apologies, I originally learned AS2 and I'm now slowly learning AS3.

baby steps.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at draganddropframe1_resetter2_0_fla::MainTimeline/frame3()
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()

this.window_mc.visible = true;

this.windwo_mc.offwindow.addEventListener(MouseEvent.CLICK, shutwin);

function shutwin(event:MouseEvent):void

{ 
    this.window_mc.visible = false;
}   

UPDATES -----------

A method that appears to have worked around it by changing the direct path to 'this'. Clicked inside the movieclip, added a layer called actions and inserted this script that referenced the movieClip I wanted to hide when clicked.

this.addEventListener(MouseEvent.CLICK, fl_ClickToHide);

function fl_ClickToHide(event:MouseEvent):void
{
    this.visible = false;
}

Answers


The error you are getting means an object, (moveiclip, variable, etc ) doesn't exist.

Go to your publish settings, and check the box that says "permit debugging". Then when you get that error in your output window it will also display the exact line number the error occurred on. That line will probably tell you what object is null.


It looks like you have a typographical error in your second line. This line

this.windwo_mc.offwindow.addEventListener(MouseEvent.CLICK, shutwin);

should be

this.window_mc.offwindow.addEventListener(MouseEvent.CLICK, shutwin);

You've interchanged w and o.

Otherwise, I would suggest doing Ribs's answer.


UPDATES ----------- "from me "

A method that appears to have worked around it by changing the direct path to 'this'. Clicked inside the movieclip, added a layer called actions, and inserted this script that referenced the movieClip I wanted to hide when clicked.

this.addEventListener(MouseEvent.CLICK, fl_ClickToHide);

function fl_ClickToHide(event:MouseEvent):void
{
    this.visible = false;
}

Place this script inside the Movie.


Need Your Help

How would increasing the edge weight on a graph affect the Dijkstra's algorithm?

dijkstra

The question is: Consider the directed graph with 5 vertices. Let the Dijkstra’s

Run python script from Gnome desktop

python

I'm running CentOS on a virtual machine and am just starting to mess with python. I'm relatively new to Linux and I'm trying to figure out how to execute a python script with a double click on the ...