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
588 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
  • 7
  • 6
14 Comments
 
LVL 9

Accepted Solution

by:
asaivan earned 125 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The goal of the tutorial is to teach the user how to how to record live broadcast.

825 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