Skip to main content
August 31, 2011
Question

Help with error #1010

  • August 31, 2011
  • 1 reply
  • 512 views

stop();

closeBtn.addEventListener(MouseEvent.CLICK,closebtn1);

function closebtn1(e:MouseEvent){

MovieClip(root).flashBox1.visible = false;

}

I have the following error (with debugging on) when the code above executes, any ideas why?

TypeError: Error #1010: A term is undefined and has no properties.

at JandB0_Scene1_fla::flashBox1_9/closebtn1()[JandB0_Scene1_fla.flashBox1_9::frame5:4]

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
August 31, 2011

If line 4 in the fourth line shown, then chances are flashBox1 doesn't exist when/where that code executes.  Try tracing MovieClip(root).flashBox1 on the line before you try to make it invisible.

August 31, 2011

So I did the trace and it came out undefined. But why? I have no clue why it would be undefined.

Ned Murphy
Legend
August 31, 2011

While this is a 1010 error, it can be caused by matters similar to a 1009 error...

The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
 
- is not in the display list
- doesn't have an instance name (or the instance name is mispelled)
- does not exist in the frame where that code is trying to talk to it
- is animated into place but is not assigned instance names in every keyframe for it
- is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).

Also, as a 1010 error it is always possible that you are trying to use a property that the object doesn't have, but since the property is the "visible" one, I'll assume that whatever the object is, it has a visible property... you can make sure of this if you have doubts.