Question

I'm creating a flash site and I have a few buttons that link to the restaurants webistes on facebook, twitter, etc. When I publish and preview in a browser though the buttons don't work. They register as clickable and the site itself works fine, but no matter how much I click the facebook/twitter button a new window never opens. My code is below and for each button it is the same thing, just a different URL. I've also gone into the flash settings and added all the websites to the local storage settings by site, but no luck.

facebookNav.addEventListener(MouseEvent.CLICK, facebookClick);

function facebookClick(event:MouseEvent):void{
  var req:URLRequest = new URLRequest("https://www.facebook.com/pages/Citra-a-fresh-cafe/189158417859080");
  navigateToURL(req, "_blank");
} 
Was it helpful?

Solution

You need to add parameter allowScriptAccess=always in your html page. Something like this:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" >

        <param name="movie" value="your_movie_path.swf">

        <param name="AllowScriptAccess" value="always">        

        <embed type="application/x-shockwave-flash"

        href="your_movie_path.swf"

        AllowScriptAccess="always" >             

        </embed>             

</object> 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top