Skip to main content
Known Participant
December 11, 2011
Question

AS3 swf buttons don't work when in html

  • December 11, 2011
  • 1 reply
  • 1335 views

I have a AS3 swf that has buttons linking to external html sites. When opened in Flash the links work fine, but when the swf is in a html page, the links don't work.

Why the links don't work when in html?

Is there something else I need to add to html code?

here is my script:

//LINKING TITLES AND LEAVES
var btn0URL:URLRequest = new URLRequest("http://www.adobe.com/");
var btn1URL:URLRequest = new URLRequest("http://www.adobe.com/");


function linkHtml(evt:MouseEvent)
{
switch(evt.currentTarget.name)
{

case "btn0":
{
navigateToURL(btn0URL,"_self");//navigate to some url
break;
}


case "btn1":
{
navigateToURL(btn1URL,"_self");
break;
}

}//end switch

}// end function linkHtml


btn0.addEventListener(MouseEvent.CLICK, linkHtml);
btn1.addEventListener(MouseEvent.CLICK, linkHtml);

Help will be appreciated.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 11, 2011

that's generally caused by incorrect embedding code.  to confirm that, publish an html from flash and upload to your site.

if that doesn't work, post your url here (leaving the flash-published html on your site) and explain what needs to be clicked to see the problem.

german01Author
Known Participant
December 11, 2011

Kglad:

Thanks for replying. It wasn't the embedded code. It was an issue with Flash Player.

It needed to be set to allow connections with external sites. Here is the document that helped me solve the problem.

http://kb2.adobe.com/cps/093/4c093f20.html

Thanks for your assistance anyway.