views:

381

answers:

1

I'm trying to call a JS function from an SWF which is loaded inside an application tab. As a canvas FBML, the code is working correctly but in case of application tab it's not working.

AS3 Code:

protected function button1_clickHandler(event:MouseEvent):void
{
  callFBJS(["insideFlex"])
}

protected function callFBJS(text:Array):void {
  var connection:LocalConnection = new LocalConnection();    
  var connectionName:String = loaderInfo.parameters.fb_local_connection;
  if (connectionName) {     
    logLbl.text = "Connection Name: " + connectionName; 
 connection.send(connectionName,"callFBJS","doSomething",text);
 logLbl.text = logLbl.text + "\n" + "Method invoked";
  }
}

JS Code:

<fb:fbjs-bridge/>
<fb:swf swfsrc="<SWF File>" imgsrc="http://www.easyhealth.org.uk/cmsimages/adobe_flash_1470_1470.jpg" height="655" width="760"/>
<script>
  function doSomething(a) {
    console.log(a);
  }
</script>
A: 

Have you figured out how to solve this? I have the same problem right now ;(

Thank you.

Greets, Mike.

Mike
The same code runs perfectly now. It was a problem with FB's API. Such things usually happens with FB so better check their Forum and Bugzilla before asking here.
kaychaks

related questions