1

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");

} 
Terry Jan Reedy
  • 18,414
  • 3
  • 40
  • 52
USERRR5
  • 430
  • 2
  • 10
  • 27

1 Answers1

0

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.

Community
  • 1
  • 1
akmozo
  • 9,829
  • 3
  • 28
  • 44