Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

1119 error

New Here ,
Jan 24, 2013 Jan 24, 2013

hi everyone!

I'm starting to learn how to work with flash, and i can't seem to get over this damn error...

Can somebody please look at my code and tell me what I'm doing wrong?

I'm getting the error for lines 21 and 22.

Thanks a lot!

error.jpg

TOPICS
ActionScript
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 25, 2013 Jan 25, 2013

Yep... "CLICK", not "Click"

You didn't recognize it but the error message probably changed since fixing the spelling.... but I think now you'll find you are still not getting what you expect due to other typos/copy-paste errors.

In the future, if you get errors be sure to provide the entire error messages in your posting

Translate
Community Expert ,
Jan 24, 2013 Jan 24, 2013

cast those obects explicitly.  for example, if they are SimpleButton's import that class and use:

SimpleButton(startPage.HillButton).addEventListener(etc...)

also, you should use the parantheses when you're creating new objects:

startPage=new StartPage();

etc

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2013 Jan 24, 2013

The error is likely indicating that as far as the compiler sees it, the two objects you are trying to target in those lines do not exist.  Make sure they exist in a current frame when that code executes and check instance names.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 24, 2013 Jan 24, 2013

Thank you both for you answers, unfortunately the problem remains...

I changed the code as kglas suggested:

code.png

but that didn't help...so i guss the problem is intance names
I'm not sure i fully comprehend the concept, maybe through the screenshots you can tell me whats wrong:

thats the .fla file (the startPage):

startPage.png

and that the relevant part of the library:

buttons.png

Can you spot the probelm?

Thanks guys!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2013 Jan 24, 2013

Instance names are the names you assign to the objects in the Properties panel, not the names you see in the library.  THe code uses those names to target the objects.

Did you manually place the hill and pond button objects inside the startPage object?  If so, you need to assign them instance names (same with the startPage).

If you are assigning those as class names for the objects then you should not use them as instance names... normally, class names start with capital letters and instance names don't, so I'd recommend changing the instance names to "hillButton" and "pondButton"

If you did not manually place those buttons inside the startPage object I have a different explanation to provide.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2013 Jan 25, 2013

Yeah I manually added the buttons.
I assinged the instance names for the buttons on the startPage:

startPage.png

But I'm still getting the 1119 for the lines that add the event listner...What am I missing..?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 25, 2013 Jan 25, 2013

If the image shows the instance names, and you have not changed the code, then you misspelled the instance names in the code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2013 Jan 25, 2013

I changed to code, the names are the same, still I'm getting that damn error 😕

I noticed that when I change the buttons names in the SimpleButton(...) it does't change anyting, but if I change the startPage to something else, it generates additional error, it's like it doesn't recognize that there are buttons on the StartPage...

If you have any other ideas, I'll be glad to hear them, if not I'll earase the whole thing and start a new one, cause I really don't know where I messed up...

Anyways, thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 25, 2013 Jan 25, 2013

Since you have a way of mixing up spelling things different ways, like you just did with startPage/StartPage, I still suspect you have naming errors.

To rule that out, try using the trace function before those two lines to see if they trace the objects properly.

trace(startPage);   // should output something like [object MovieClip]

trace(startPage.hillButton);  // should output something like [object SimpleButton]

trace(startPage.pondButton); // ditto

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2013 Jan 25, 2013

"I still suspect you have naming errors."

(or, those buttons don't exist in frame one of startPage.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2013 Jan 25, 2013

I ran trace and got:

[object StartPage]

[object HillButton]

[object PondButton]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 25, 2013 Jan 25, 2013

Show the code as youy have it now, and the complete error message(s)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2013 Jan 25, 2013

code.png

Any ideas?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 25, 2013 Jan 25, 2013

Yep... "CLICK", not "Click"

You didn't recognize it but the error message probably changed since fixing the spelling.... but I think now you'll find you are still not getting what you expect due to other typos/copy-paste errors.

In the future, if you get errors be sure to provide the entire error messages in your posting

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2013 Jan 25, 2013

Yeah that solved it!


Though, as you said, now I'm getting:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at Main()

what eve the hell that means ...but hey, thats a start, thanks a lot to both of you guys!

Btw, if you have any idea what can cause that error, please feel free to share

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 25, 2013 Jan 25, 2013

It's always better to start new postings for new problems... they get noticed faster.  The 1009 error is more definitively what I described for the 1119 error (which can cover a number of issues)....

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 declared but not instantiated

- 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).

 

If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number (following the frame number if timeline code) which will help you isolate which object is involved.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2013 Jan 25, 2013
LATEST

Yeah that solved it! After is showed the line it was a quick fix...

It was a slight misspell! ...

Works like a chram now!

Thanks a lot! To both of you guys!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines