Copy link to clipboard
Copied
So I'm using the code below so that if someone clicks on a movie clip, it takes them to a webpage:
MovieClipName.buttonMode = true;
MovieClipName.addEventListener(MouseEvent.CLICK,f) ;
function f(e:Event){
navigateToURL(new URLRequest("http://www.URL.com"), "_self");
}
This is working absolutely perfect for 2/3 movie clips in my library. However, when I try to apply the code to a third movie clip in my library using the exact same code, I get the error: 1120: Access of undefined property MovieClipName3.
I don't understand. The exact same code is working flawlessly for MovieClipName1 and MovieClipName2. Why do I get an error when I try to apply it to MovieClipName3? Thanks in advance!
Copy link to clipboard
Copied
Look for a typo in the naming or the code. Also make sure the code is in the same frame as the movieclip.
Copy link to clipboard
Copied
Thanks for the reply. I have triple checked the spelling in the code and movie clip name. The clip name matches the clip name in the code exactly. The code is in the same frame as the movie clip. The error still persists.
Copy link to clipboard
Copied
Which frame is the movieclip in... is it in a frame just after another frame where the same symbol exists under a different name?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now