?
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
?
598 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses

752 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