Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I get Error 1120 in Flash CS3 even though the code references a correctly named movieclip instance on the stage...

Posted on 2008-10-10
14
Medium Priority
?
600 Views
Last Modified: 2013-11-12
Hello - I am using Flash CS3.  When I test the movie, I get error code 1120 - access of undefined property.  The code references a movieclip (instance name SJH) and is attached to frame 1 AS of a separate movieclip (jk1_btn) that acts as a button.

The movieclip SJH is also on stage at frame 1 (and it plays a slide show for 75 frames or until one of the buttons is clicked to play a video).

The offending code (SJH._visible=false;)  is in the function below (though I was surprised that the error message is thrown immediately not when the function is called).

Any ideas why the error occurs?

Thanks!


jk1_btn.addEventListener(MouseEvent.CLICK, vid1);

function vid1(e:Event):void {
      SJH._visible=false;
      vidPlayer.source = "jenvid.flv";
}
jk2_btn.addEventListener(MouseEvent.CLICK, vid2);

function vid2(e:Event):void {
      SJH._visible=false;
      vidPlayer.source = "SJH_Rendering1.flv";
}
0
Comment
Question by:ewv1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 9

Accepted Solution

by:
asaivan earned 500 total points
ID: 22691544
In AS3, properties are no longer prefixed with the underscore.  Thus SJH._visible is now SJH.visible.
0
 

Author Comment

by:ewv1
ID: 22703909
Thanks for checking over the code for me.  However, I have tried SJH.visible as well.  The real issue is the Error 1120 message...if AS code references an object by the instance name on a frame that is after the object has been moved on the stage, then why would this error occur?  

I tried accomplishing it using object-oriented code as well, placing the FLVPlayer on stage at a certain x and y coordinate after a movie clip of tweened images (basically a slide show type intro) had run, and again I got the Error 1120.
0
 
LVL 9

Expert Comment

by:asaivan
ID: 22704165
It sounds like a typical Asynchronous error, are you sure all your clips have been added to the stage before the code is called?
0
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 

Author Comment

by:ewv1
ID: 22704465
Yes, the movieclip of instance name SJH is on the stage from frame 1.

I get the same error 1120 when I try the code below (where jk1_btn is a movie clip that acts like a button) - however the undefined property is jk1_btn in this case.  But in the example from my first post, jk1_btn is recognized (but movieclip SJH is not).

Maybe I am missing something conceptually?

Thanks again for any advice or insight

function m_over(e:Event) {
      jk1_btn.gotoAndPlay("in");
}

jk1_btn.addEventListener(MouseEvent.MOUSE_OVER, m_over);

function m_out(e:Event) {
      jk1_btn.gotoAndPlay("out");
}

jk1_btn.addEventListener(MouseEvent.MOUSE_OUT, m_out);

0
 
LVL 9

Expert Comment

by:asaivan
ID: 22704875
In your MovieClip properties, do you have them set up for export to ActionScript?
0
 

Author Comment

by:ewv1
ID: 22704993
Yes.  MovieClip SJH is the name for an instance of SJH_1 - which is in the library and is set to export to AS.
0
 
LVL 9

Expert Comment

by:asaivan
ID: 22705150
Well, if you want I can look at your FLA file?
0
 

Author Comment

by:ewv1
ID: 22705309
That would be great!  

Should I zip it and attach here or send to you?

Thanks again for your time.
0
 
LVL 9

Expert Comment

by:asaivan
ID: 22705514
you can send it to spiritualresponse@gmail.com
0
 

Author Comment

by:ewv1
ID: 22705696
I e-mailed the file (9 MB).  It has not bounced back, but if it's too large for your e-mail acct, I will download  WinZip, zip it and re-send.
0
 
LVL 9

Expert Comment

by:asaivan
ID: 22705857
For whatever reason, I'm not getting that error.  I don't know why, but it's not happening for me.  Actually, I got the error once, then when I tested again it didn't show.  So I redownloaded the app from email, but I still didn't get the error, it's starting to sound more like a Flash IDE bug...
0
 

Author Comment

by:ewv1
ID: 22705996
OK - so maybe I should just build a new FLA file?  I'll do a search for IDE bugs to see what I find.  

Unless you have other ideas...

Once again, thanks so much for your time and willingness to help.
0
 
LVL 9

Expert Comment

by:asaivan
ID: 22706101
No Problem.  What you might try is indeed copying and pasting all of your data into a new Flash file...something weird is up.  I've had problems like that before where some bit isn't happy and is causing a rebellion somewhere in the program ;)

Try it and let me know how it goes.  
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question