问题
I created this banner with Flash and I need that on click it opens a web page.
I used this Actionscript 3.0 code...
link_btn.addEventListener(MouseEvent.CLICK, openurl);
function openurl(event:MouseEvent):void {
var url:URLRequest = new URLRequest("http://www.festivity.it");
navigateToURL(url, "_blank");
}
BUT it's not working!
WHYYYYY?!
I tried setting it on the timeline and also on a button, but nothing changed.
Whenever I click on the button... nothing happens, but sometimes a message opens with a security alert.
Thanks.
Chiara
回答1:
Make sure your publish settings enable network access from "local playback security":
回答2:
I have spent hours and hours working with the action code snippets. My head was practically bleeding, trying to figure out why my simple Go-To-URL action script wasn't working. I've been using a much older version of Flash for ten years. The "local playback security" setting was the problem, and it was not mentioned in any of the Adobe forums that I visited. What a frustrating "feature".
来源:https://stackoverflow.com/questions/13140817/flash-not-opening-links-on-click