views:

258

answers:

4

Hello Everyone,

I have successfully integrated PayPal Express into a Flex application. In DoExpressCheckoutPayment.php, I have the following JavaScript line of code that will not execute:

window.opener.window.document.getElementById('index').paymentComplete();

'index' - http://mysite.com/index.html# contains index.swf 'paymentComplete()' - the function that finishes processing the transaction

Has anyone successfully activated callback methods back from a popup to a Flex application using JavaScript?

Thank you in advance for any help,

Orville

A: 

SWFAddress would be a really good solution for this.

Joel Hooks
I did not see anything there related to my problem. I probably did not explain the scenario well enough.
A: 

In Flex, the address in URLRequest was absolute (http://mysite.com/phpfolder/) and not relative (/phpfolder) to the SWF. For some reason JavaScript requires the relative URL for the following line to work. I am not sure why.

window.opener.window.document.getElementById('index').paymentComplete();
A: 

If you can get the popup to call a JS method in the html page that holds the flex app, you can use addCallBack method of the ExternalInterface class to make that JS method communicate with the flex app.

Amarghosh
A: 

for getElementById use the id from the EMBED-tag in the OBJECT-tag .. not the id from the OBJECT-tag itself!

Mace