PDA

View Full Version : Sending variable from javascript to flash


alezz
09-23-2009, 02:55 PM
Hello, I have googled this question a bit, but I havent seen a solution yet. :eek:

The thing is that we have a user conquest going on in doman1.com that needs to check that the user is already logged-in on domain2.com.

We have a top bar from domain2.com that includes the java functions that checks that the user is logged in and also retrives the username.

The problem is that since that java function uses a 'return' to send back the variable within the function, Flash thinks that is an URL and tries to load the function itself in the address bar.

What I need now is a way to send the variable form Javascript to flash without using return on the function.. I know I can update the URL, but this is a variable that should be hidden form users.

Thank you very much in advance!!

tadster
09-23-2009, 03:32 PM
You'll need to use the External Interface, read the other threads in this section for more info.

smftre
09-23-2009, 05:03 PM
Or you could just encode the values sent to the flash file, then the user(s) dont even know what it is.

vinayak.kadam
09-25-2009, 01:08 PM
Please look at this (http://board.flashkit.com/board/showthread.php?t=760831)thread to learn more about externalInterface!

As ever,
Vinayak Kadam

alezz
09-28-2009, 05:04 PM
Thank you very much for the reply!! :)

I had already found this link with a good solution:

http://www.adobe.com/devnet/flash/articles/external_interface.html

vinayak.kadam
09-29-2009, 06:11 AM
Yup, thats a perfect explanation for ExternalInterface class.....no body can beat Adobe guys :)