Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rating: Thread Rating: 23 votes, 5.00 average. Display Modes
Old 11-01-2011, 02:36 PM   #1
betjo
Registered User
 
Join Date: Nov 2011
Posts: 6
Default TypeError: Error #1010: A term is undefined and has no properties.

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.dialooglevel 23.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!
betjo is offline   Reply With Quote
Old 11-01-2011, 02:40 PM   #2
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

Quote:
Originally Posted by betjo View Post
Symbol level4 has the instance name Level4
if the instance name is 'Level4'

wouldn't your code need to be like..

ActionScript Code:
Object(root).Level4.balkdialooglevel2.dialooglevel23.gotoAndStop(2);
your original code example has 'level4'.. not 'Level4'
__________________
Always optimizing...
xxneon is offline   Reply With Quote
Old 11-01-2011, 03:59 PM   #3
betjo
Registered User
 
Join Date: Nov 2011
Posts: 6
Default

Sorry, my bad. It says both level4 in my flash file, so that's not the problem. I accidently added a capital L in my topic description.
betjo is offline   Reply With Quote
Old 11-01-2011, 04:06 PM   #4
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

probably the best thing now would be an additional set of eyes on the file.

or try doing a bunch of trace statements to see which part of that long string of clips is broken.
__________________
Always optimizing...
xxneon is offline   Reply With Quote
Old 11-01-2011, 04:13 PM   #5
betjo
Registered User
 
Join Date: Nov 2011
Posts: 6
Default

Quote:
Originally Posted by xxneon View Post
probably the best thing now would be an additional set of eyes on the file.

or try doing a bunch of trace statements to see which part of that long string of clips is broken.
Could you perhaps explain me how you do those trace statements? I've never done them before. Do I have to make a new keyframe in the main timeline with ActionScript traces? Or do I add some traces lines in the button which contains the error?
betjo is offline   Reply With Quote
Old 11-01-2011, 04:14 PM   #6
northmantif
dont Re Member
 
Join Date: May 2009
Location: Poland
Posts: 739
Default

debug it with this procedure:
trace(Object(root).level4.visible);
//property visible is here only to confirm that the instance is found.
then if true
trace(Object(root).level4.balkdialooglevel2.visibl e)
then if true
trace(Object(root).level4.balkdialooglevel2.dialoo glevel23.visible)
if all are true, you have something screwed with your gotoAndStop(2) method. Probably there is an object in that you want to refer in the code to, but it doesnt exist in that frame.
northmantif is offline   Reply With Quote
Old 11-01-2011, 04:27 PM   #7
betjo
Registered User
 
Join Date: Nov 2011
Posts: 6
Default

Quote:
[object level4_116]
[object balkdialooglevel2_127]
null
[object level4_116]
[object balkdialooglevel2_127]
null
Thats what I get after I added trace lines in the main timeline.

Do you mind if I upload my project, and post a link to it in this topic so you guys can have a better look at it?

Last edited by betjo; 11-01-2011 at 04:31 PM.
betjo is offline   Reply With Quote
Old 11-01-2011, 05:43 PM   #8
northmantif
dont Re Member
 
Join Date: May 2009
Location: Poland
Posts: 739
Default

Quote:
Originally Posted by betjo View Post
Do you mind if I upload my project, and post a link to it in this topic so you guys can have a better look at it?
Most of times I only frown when see guys trying to help when the issue is about #1009 or #1010 coming along playing with timelines. Those topics are rarely thiner than 10 posts, and you can see incremental procedure of questions and answers which lead to nothing. I mean none of us should event touch the topic as the first thing questioner should do is to upload .fla file or give a link to it...This way we can save not only time, but power and money, and sometimes someone's health too
northmantif is offline   Reply With Quote
Old 11-01-2011, 05:57 PM   #9
betjo
Registered User
 
Join Date: Nov 2011
Posts: 6
Default

Quote:
Originally Posted by northmantif View Post
Most of times I only frown when see guys trying to help when the issue is about #1009 or #1010 coming along playing with timelines. Those topics are rarely thiner than 10 posts, and you can see incremental procedure of questions and answers which lead to nothing. I mean none of us should event touch the topic as the first thing questioner should do is to upload .fla file or give a link to it...This way we can save not only time, but power and money, and sometimes someone's health too
My apologises, I did not mean to upset you in any way. I'm sincerely grateful that you guys take the time to help me out.

I uploaded the files. It's a .rar file cause you need the sounds as well for it to work. So it contains the .fla and the sounds.

this is the url:

I need a post count of 50 or greater to be able to post links so I'm trying it without the http

dl.dropbox.com/u/7903706/Error.rar (add http in front of it)

Again, thanks in advance. This is the final obstacle between me and the final product.

It's on the main timeline, the 5th keyframe in some kind of candy shop. Then on the layer Dialoog, there's a symbol called balkdialooglevel2. when you enter that go to frame 76 and click on the dialogues. after that, click on the 3rd answer (which takes you to level2antwoord1.3) and go to frame 15. The trace is on the top layer, the error is on the one beneath

Last edited by betjo; 11-01-2011 at 06:01 PM.
betjo is offline   Reply With Quote
Old 11-01-2011, 06:40 PM   #10
xxneon
Super Moderator
 
xxneon's Avatar
 
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
Send a message via ICQ to xxneon Send a message via AIM to xxneon Send a message via MSN to xxneon Send a message via Skype™ to xxneon
Default

well I was able to get the error resolved .. but then a new type error came up.

to fix the original error you encountered .. you need to assign the instance name 'dialooglevel23' to the movieclip for frame 1 and 57 in the balkdialooglevel2 clip.

Sometimes if you don't assign the instance name in the first keyframe or all the key frames the desired instance name doesn't stick sometimes. Usually if you make sure to assign the instance name on the first keyframe of existence you are usually ok.

now to the second error.

found in..level4 > balkdialooglevel2 > dialooglevel23 : frame 2 > instance of 'level2antwoordgoed2.1'
ActionScript Code:
Object(root).level4.dialooglevel2.gotoAndStop(3);
its giving me a type error because it's trying to target 'diaglooglevel2' which there is no such clip. Is it supposed to target 'balkdialooglevel2' ??

it almost looks like this should be the correct line..
ActionScript Code:
Object(root).level4.balkdialooglevel2.dialooglevel23.gotoAndStop(3);
I mean with this there is no errors .. but it doesn't do anything after that.

and if you do..
ActionScript Code:
Object(root).level4.balkdialooglevel2.gotoAndStop(3);
the dialog box disappears..

hope this helps.
__________________
Always optimizing...

Last edited by xxneon; 11-01-2011 at 06:46 PM.
xxneon is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:54 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.