Actionscript 3 Type Error #1010
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn flex error 1010 more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags as3 error 1010 Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like as3 error 1010 term undefined you, helping each other. Join them; it only takes a minute: Sign up Error in Actionscript 3 - “TypeError: Error #1010: A term is undefined and has no properties.” up vote 0 down vote favorite I cannot for
A Term Is Undefined And Has No Properties As3
the life of me find any undefined term in this code. The compiler isn't returning a line, just an error that says, "TypeError: Error #1010: A term is undefined and has no properties. at Snakev1_fla::MainTimeline/update()" Here's the code: function update(e:Event):void { if (keys[Keyboard.RIGHT]) { directions["right"] = true; } if (keys[Keyboard.LEFT]) { directions["left"] = true; } if (keys[Keyboard.UP]) { directions["up"] = true; } if (keys[Keyboard.DOWN]) { directions["down"] = true; } var i:int = segments.length - 1; while typeerror error #1010 (i > 0) { segments[i].y = locations[locations.length - 6][1]; segments[i].x = locations[locations.length - 6][0]; i--; } if (directions["right"]) { head.x += 5; } if (directions["left"]) { head.x -= 5; } if (directions["up"]) { head.y -= 5; } if (directions["down"]) { head.y += 5; } directions["up"] = false; directions["down"] = false; directions["left"] = false; directions["right"] = false; locations[locations.length][0] = head.x; locations[locations.length][1] = head.y; trace(locations); if (head.x < food.x + food.width / 2 + head.width / 2 && head.x > food.x - food.width / 2 - head.width / 2 && head.y > food.y - food.height / 2 - head.height / 2 && head.y < food.y + food.height / 2 + head.height / 2) { food.x = Math.random() * 490; food.y = Math.random() * 490; var body:part = new part(); body.x = locations[locations.length - 6][0]; body.y = locations[locations.length - 6][1]; body.width = head.width; body.height = head.height; segments[segments.length] = body; addChild(segments[segments.length-1]); } } actionscript-3 share|improve this question asked Mar 17 '14 at 15:57 user2740392 2215 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted At least one of your variables are null. You can set a breakpoint at the start of the function and step line by line until it crashes, which should tell you the problem line, and problem variable. You can also put trace (keys == null); trace (directions == null);
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and as3 typeerror: error #1010 policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only http://stackoverflow.com/questions/22459150/error-in-actionscript-3-typeerror-error-1010-a-term-is-undefined-and-has-n takes a minute: Sign up TypeError: Error #1010: A term is undefined and has no properties. AS3 up vote 0 down vote favorite 1 This is my code: import flash.events.MouseEvent; function getCombos(masterword){ var combos:Array; var a:Array; var i:int; var l:int; function nextLetter(a,l,key,used){ var i:int; if(key.length == l){ return; } for(i=0;i
Error 1010....what is undefined? If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the http://board.flashkit.com/board/showthread.php?732321-Error-1010-what-is-undefined register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 20 of 20 Thread: Error 1010....what is undefined? Tweet Thread http://www.deitte.com/archives/2007/02/error_1010_a_te.htm Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 05-23-2007,05:24 PM #1 databell View Profile View Forum Posts Visit Homepage Senior Member error #1010 Join Date Jul 2000 Posts 373 Error 1010....what is undefined? This is really strange. I've got a button symbol on stage with an instance name of aboutUs_btn. My code on my AS layer is: this.aboutUs_btn.addEventListener(MouseEvent.MOUSE _DOWN, about); function about(evt:MouseEvent):void { this.wipe_mc.gotoAndPlay(2); this.gotoAndStop("history"); head.unload(); } And then I test the movie and get this error and it makes no sense to me. TypeError: Error #1010: A term is undefined and as3 error 1010 has no properties. at main1_fla::MainTimeline/about() What's weird is I tried this in another .fla and it didn't bring up the error. That makes no sense. They've both got Publish Settings for AS3/FL9 Adam Bell dzign@datatv.com -- Over 90% of all websites suck...... Join the minority. Reply With Quote 05-23-2007,05:50 PM #2 senocular View Profile View Forum Posts Visit Homepage half as fun, double the price Join Date Feb 2002 Location San Francisco, CA (USA) Posts 4,361 trace your values and see if any come up undefined (or use the debugger to check out their values during playback) Reply With Quote 05-23-2007,06:09 PM #3 databell View Profile View Forum Posts Visit Homepage Senior Member Join Date Jul 2000 Posts 373 I don't know how to do that. Adam Bell dzign@datatv.com -- Over 90% of all websites suck...... Join the minority. Reply With Quote 05-24-2007,04:44 AM #4 tonypa View Profile View Forum Posts Visit Homepage Senior Member Join Date Jul 2001 Location Estonia Posts 8,227 Most likely you do not have movie clip with instance name "wipe_mc" on stage when code is run. My games, Tile based tutorials, Vectors, Latest update - fastazzi Reply With Quote 05-24-2007,08:45 AM #5 cancerinform View Profile View Forum Posts Visit Homepage
term is undefined and has no properties". One of the iframe posts is bringing people here, but they aren't getting any error details from the post. You can read more about this error and all other runtime errors in the language reference. This error most commonly occurs when you try to access a property on an undefined Array item. For example: var array:Array = new Array(); var noProp:Object = array[1].prop; You may run into this error in the framework, especially in the datagrid. To read more about this, try a mail-archive.com search of flexcoders. Tags: flash, flex Posted on February 17, 2007 4:16 PM | Permalink | digg | del.icio.us Comments (11) Daniel Lawhead: Hey thanks! That's a rather odd error for a non-existent array element. Posted by Daniel Lawhead | December 3, 2007 7:10 PM Posted on December 3, 2007 19:10 HardlyNoticable: Actually, I think you can get this error when you try to access the member that doesn't exist, or the member of a non-existent instance. For instance, I just looked this up when a friend was having an issue and it turned out he had forgotten to name the instance of an object (that he was trying to access). Posted by HardlyNoticable | December 11, 2007 2:43 PM Posted on December 11, 2007 14:43 Cenovis: I got this error in Flash and found your page via Google. It turned out I had not properly coded my for loop's condition and was trying to access an object that didn't exist. So thanks HardlyNoticeable and blog owner, you both led me to a quick and painless solution. Posted by Cenovis | September 8, 2008 4:09 AM Posted on September 8, 2008 04:09 Andres Calderon: I was migrating my flash animation from AS2 to AS3 and I forgot I had changed the instance names of two movie clips, but I didn't change the names in the Actionscript code. Your comments led me to a quick solution. Thanks! Posted by Andres Calderon | November 26, 2008 12:06 PM Posted on November 26, 2008 12:06 Mosselman: Thanks guys. I got the error when trying to access an undefined index in an Array. Hope this helps more people. Posted by Mosselman | May 4, 2009 3:54 PM Posted on May 4, 2009 15:54 alin: Hi guys, I just got over this 110 error. And i figured it out after some hors of stress with it. I thought i should post it here so that i might help someone int he future. My problem was that i had one MC that was creating a movie clip using a MenuItem object from the library. All fine and well but then at some point i loaded and external swf using loader class which had it's own lill menu using it's own MenuItem object. Remember was an external MC. And that is where the error popped up. Solution: Renamed the MenuItem in the external MC into docI