views:

1366

answers:

3

Hi,

I'am currently developing a Facebook application which has a iFrame in it. The iFrame loads a Java applet (So the FBML Page is just a wrapper for header footer and the FBML functions).

The current situation is, for example, the Java applet has a event (User finished playing a game) and it does a javascript call on the iFrame page. What it then needs to do is call a javascript in the parentwindow (Facebook.streamPublish()) so that the user gets the ability to publish his score / event / win / loss whatever.

iFrame code on FBML Page :

<fb:iframe id='appletIframe' frameborder='0' resizable='true' scrolling = 'no' name='appletIframe' src='appletPage.php'></fb:iframe>

Every time i try to communicate with the parent, i get a access denied because it is a cross domain call. I wonder if its possible with Facebook.connect or some other technique to make calls to the parent or if there is any other way. If a user finishes a game, there should be a minimal delay between the iFrame call and Parent call.

The reason i do the applet in the iFrame is, because the applet is deployed by deployJava (Class distributed by Sun) and if i run that on a facebook FBML Page, the Javascript navigator class will get appended (a_navigator) and it wont run.

I hope i was clear enough in the description, anyone have any idea's?

Thanks in advance for the help,

Michael

A: 

Hello i just have experienced this problem and wanted to do something like you and i felt hacked .But what i did was use it yourApplet.getAppletContext().showDocument(url,"_parent");.This helps me to redirect to other window where i have the script to publish.In this new window,i have a button to publish via javascript a story.This button could not be necesary

It is important to use the "_parent", so you can redirect the parent window.

I wish this helps

martin de la torre
A: 

Redirecting is fine.But how are you sending the scores/results. Are you appending in the url ?

javangelo
A: 

anyone have some idea about that? it's seems Zynga Poker working with FBML and the game (also the buddies below) are FBML's iFrames and i think they're calling the parent (the FBML) form those iFrames, you can try it if you'll goto the application and click on the "ADD MORE POKER BUDDIES" on the lobby and you'll see that the pop-up that appear is an HTML div that 'sitting' outside of the game iFrame.

how they're do that???

Garfiled22