Skip navigation
betjooo
Currently Being Moderated

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

Nov 1, 2011 7:45 AM

Hi there,

 

I'm trying to make a minigame with dialogues. There's this thief which you caught and when you talk to him you have to choose the right dialogue answers so he doesn't freak out.
I'm doing this with movieclips (and turning them into buttons with A.S. so I can make them fade in and out when you click on it). So to give you an example it looks like this:

 

(Button: Hi there) Click on it -> Dialogue fades out with alpha.......... New dialogue fades in with alpha and you're able to pick another option.

 

I've done this before and it worked all the time but when I tried it again today it starting bugging on me. I'm referring from one button to the other button with this code:

 

Object(root).level4.balkdialooglevel2.dialooglevel23.gotoAndStop(2);

 

I checked every symbol and they all have the correct instance name. Symbol level4 has the instance name Level4, symbol balkdialooglevel2 has the instance name balkdialooglevel2 and so forth.

But when I test it and click on the button, it gives me this error:

 

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

 

I don't know what I'm doing wrong. Perhaps ActionScript didn't load the symbols yet when I'm trying to refer to it?

And how do I fix this?

 

It's quite a big deal that I'm able to fix this, since I'm making this project for the Police in the Netherlands. (School project).

 

I'm sorry if my English isn't that good. As you can see I'm from the Netherlands.

 

Thanks in advance!

 
Replies
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 1, 2011 7:55 AM   in reply to betjooo

    use the trace function to debug and make sure that is the problematic line of code (click file/publish settings/flash and tick "permit debugging" so the problematic line number is in your error message).

     

    trace(Object(root).level4);

    trace(Object(root).level4.balkdialooglevel2);

    trace(Object(root).level4.balkdialooglevel2.dialooglevel23);

     


     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 1, 2011 10:33 AM   in reply to betjooo

    is

     

    Object(root).level4.balkdialooglevel2.dialooglevel23.gotoAndStop(2);

     

    on line 130?

     

    if so, copy and paste the code i suggested just above your current line 130.

     

    p.s.  i don't download and correct files unless i'm hired.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Nov 1, 2011 11:22 AM   in reply to betjooo

    Object(root).level4.balkdialooglevel2 exists but dialooglevel23 doesn't exist in Object(root).level4.balkdialooglevel2 when those trace functions execute.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points