I want to link as3 code to a webpage. I click a button and then go to a web page. I used navigateToUrl. When I compile my fla file then the button is working perfect, going to the required webpage. But without compiling the fla file, when I directly run my swf file, then I cannot go to the required webpage. Why does this happen? Here is my code.
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.navigateToURL;
import flash.net.URLRequest;
link3.addEventListener(MouseEvent.CLICK, WebHyperlink);
link3.buttonMode=true;
function WebHyperlink(e:MouseEvent)
{
var myURL:URLRequest = new URLRequest("http://www.republicofcode.com/");
navigateToURL(myURL, "_blank");
}
You have a security exception because Flash Player blocks internet access to your swf file. To see that exception, you can install a Flash Player debug version from here and to avoid the problem, take a look on my answer for this question.
Hope that can help.