Reputation: 541
I have an image uploader that runs on a separate PHP script, and then updates the Preview Url after the file has been uploaded. But what I'd like to do is have a Flash SWF embedded in the same HTML that's running the PHP Uploader to get that Preview URL and display it in the Flash Application.
What would you suggest be the best way to go about sending this PHP variable to Flash?
Thanks in advance!
Aaron
Upvotes: 0
Views: 675
Reputation: 4071
You cannot asynchronously send a value from PHP (server-side) to Flash (client-side). You have to either pass it in on embed-time through a flashvar (although I doubt this will work in your case since you want this transfer of information to occur after a load operation) or your Flash application will need to query the server, and have the server return the correct value.
A third option would be to use the ExternalInterface
API in Flash to let your HTML notify the Flash application via javascript when the URL is available.
Since I don't know your general set-up, it's hard to recommend one way over another, but the general reasons for going with one over the other are:
URLLoader
to query the server for the preview URL, specifying the file id or similar as a GET or POST variable.Hope this helps. Please elaborate on the details of your architecture for a more thorough answer.
Upvotes: 2
Reputation: 1726
See these pages
http://code2design.com/tutorial/sending_variables_from_flash_to_php_and_back
http://www.flashvista.com/details/item/279/
Upvotes: 0