AS3 swf buttons don't work when in html
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.