Skip to main content
Participant
June 22, 2008
Question

1120: Access of undefined property Home_btn.

  • June 22, 2008
  • 5 replies
  • 622 views
Hi, Im new in Flash CS3. I have a flash tutorial and and im doing exactly what the tutorial does but with my design.

I an standing in the Home frame and writing this on the action label

stop();

function onHomeClick(evt:MouseEvent):void {
gotoAndStop("Home");
}
Home_btn.addEventListener(MouseEvent.CLICK, onHomeClick);

The error i recieve is this
1120: Access of undefined property Home_btn.

I just want to configure the buttons to navigate.

Any ideas?

Do i have to define the buttons some other way?

Thanks
This topic has been closed for replies.

5 replies

kglad
Community Expert
Community Expert
September 30, 2008
that code wouldn't generate that message. you have some other code elsewhere causing that message.
Participant
September 29, 2008
I'm having the same problem, but I seem to have it set up right, it just doesn't work. I have an invisible button (named URLButton) covering my entire banner and I've got this code on an action keyframe on a separate layer. My code is as follows:

function gotoAdobeSite(event:MouseEvent):void
{
var adobeURL:URLRequest = new URLRequest(" http://www.virtuox.net/");
navigateToURL(adobeURL);
}

linkButton.addEventListener(MouseEvent.CLICK, gotoAdobeSite);


When I check this using the COMMAND key and the RETURN key, I get the error: 1120: Access of undefined property URLButton.

I've even tried changing "linkButton" to my button's name and I get the same issue! I've checked my code 100 times and have combed the web. I'm completely confused at this point! I'm not a programmer. I'm just trying to figure out why adding a URL to text is so easy and adding one to a graphic is a real brain bender!

Thanks for any help! This "issue" is making my DNA unravel!
kglad
Community Expert
Community Expert
June 22, 2008
on the timeline that contains your posted code, there needs to be an object (like a button) with instance name Home_btn and it needs to exist no later than the frame that contains your code.

if you had that button with that instance name, you wouldn't see that error message. so, double check the properties panel for that name and look for a typo.
Participant
June 22, 2008
Correction, the buttons name is "Home_btn"

I have the instance name in the button, what do you mean with an object?

Thanks
kglad
Community Expert
Community Expert
June 22, 2008
you're lacking an object with instance name Home_btn.
Participant
June 22, 2008
Thanks for answering!!

My button has "Homs_btn" in the instance name. Do I have to name another object?
Thank you