Copy link to clipboard
Copied
Hello, all. I'm having a simple but very frustrating problem in Flash CS5 with Actionscript 3. I'm trying to set up a link in an image, when you mouseover the image, it says video and I want to be able to click on it and have it lead to a new URL. I've gotten the swinging right and have tried (what seems like) every actionscript code out there. Currently I have:
/* Click to Go to Web Page
Clicking on the specified symbol instance loads the URL in a new browser window.
Instructions:
1. Replace http://www.adobe.com with the desired URL address.
Keep the quotation marks ("").
*/
help_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
function fl_ClickToGoToWebPage(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.adobe.com"),
"_blank");
}
Which is the basic code snippet, but it won't load adobe.com or any other site and doesn't show any error messages. Might anyone have any thoughts or suggestions?
Thank you in advance,
Katie
Copy link to clipboard
Copied
There's nothing wrong with the code. You should put a trace in the function to verify it's getting called.
Copy link to clipboard
Copied
How do I do that? (Sorry, I'm quite new at this)
Copy link to clipboard
Copied
You could look in the help, as you need to learn to use trace - it's very useful for debugging. That being said - you just do like:
function fl_ClickToGoToWebPage(event:MouseEvent):void
{
trace("fl_Click was called successfully");
navigateToURL(new URLRequest("http://www.adobe.com"), "_blank");
}
If the function is called, you will see the text appear in the Output window.
Copy link to clipboard
Copied
I see the same problem but it appears to be an IE problem. Gee, what else is new? Linking works fine in Mac/PC FF-Chrome-Safari. No go in IE 6 or 7. Have not checked IE8.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more