Skip navigation
SimonHenbury
Currently Being Moderated

1010: A term is undefined and has no properties.

Jan 18, 2013 8:40 AM

Tags: #and #no #a #3.0 #actionscript #has #is #undefined #1010 #term #properties.

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

     at GameController/update{}

 

is the error i have been getting

 

Here is my game = http://www.filehosting.org/file/details/412784/alt.rar

 

Test 3 is the main document

 

im not really sure what to do at the moment when i load my game and hit play it works fine for until an enemy appears then i get this error constantly

dont really know how i can explain any better over text

 

thanks alot

 
Replies
  • Currently Being Moderated
    Jan 18, 2013 8:50 AM   in reply to SimonHenbury

    Go into your flash publish settings and check the box "permit debugging" now the error should tell you what line is causing the problem.

     

    Overall it means that something doesn't exist, have the name you think it does, or is in a different scope at the time that line is trying to do something with it.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 18, 2013 8:51 AM   in reply to SimonHenbury

    Go into your Flash Publish Settings and select the option to Permit Debugging.  Then run the file again and review the error message.  That can help by including in the error message the line number where the error occurs.  Once you know which line is involved you can try to use the trace() function to isolate which element is undefined.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 18, 2013 9:26 AM   in reply to SimonHenbury

    Is that the complete error message that you get or is there more information that you did not copy from it?

     

    If that's all you get for the message, then it looks like there might be something named update somewhere that is involved with the error.  If you can locate something of that then you should be able to use the trace() function to try to isolate what element is coming up as undefined.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 18, 2013 11:10 AM   in reply to SimonHenbury

    No need to apologize... we were all bad at AS3 at some point, and I still am in many respects.

     

    The way to use the trace() function is to have is tell you the status of things while your file is executing.

     

    So if you can find a function called update in your file(s), what you could do is just insert

     

        trace("got this far");

     

    before the first line of code inside the function.  When you run the file, the trace output is displayed in the Output panel in Flash.  So if your Output panel shows "got this far" (no quotes) before the error message occurs, you know you haven't reached the line of code that has the problem. 

     

    So then you can move that trace down a line and try again, and repeat until you don't see "got this far" anymore.  When you don't see it anymore, the line just before the trace line is where the problem likely lies.

     

    At that point, move back before that line and uswe the trace to try to figure out which part of that line is undefined by tracing the objects or properties it uses.  Suppose the line of code is....

     

    someMC.aChildMC.property = something;

     

    Then before that line you could use...

     

    trace(someMC);

    trace(someMC.aChildMC);

    trace(someMC.aChildMC.property); ##########

     

    And then the out will likely display one or more of them as "undefined".  Whichever is the first undefined one is where you need to focus and figure out why it is undefined.  REfer to Rothrock's suggestions for some reasons why it might be.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 19, 2013 4:30 AM   in reply to SimonHenbury

    I have a button the uses the code snippet of loading another .swf but the game works fine on its own .swf its when i load it through the menu.swf it goes wrong

    This is a hint that you have a problem with your scopes.

    Also what sinious said:

    Go into your flash publish settings and check the box "permit debugging" now the error should tell you what line is causing the problem.

     

    Overall it means that something doesn't exist, have the name you think it does, or is in a different scope at the time that line is trying to do something with it.

    if you did like you were advised, post the new Error message you get. Publish your movie and look in the output window.

     

    Instead of your old error messaeg:

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

         at GameController/update{}

    you should get now the information at what Line this code fails.

     

    Mark the line in your GameController.update function and post it again.

     
    |
    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