tags:

views:

22

answers:

1

I have a web page with a button that does a redirect to another web page with a flash movie in it. The button on the first page sends http post data as part of it's functionality.

How do I read this post data in my flash movie? Is this possible?

A: 

Not directly, POST data is sent to the server, which responds with a response body (and headers). You'll have to work with that data. However, you can of course put the POST data in your response body and give them to your swf that way, via FlashVars.

<param name="FlashVars" value="foo=bar">

Flash can access FlashVars as global variables.

Peter Kruithof
Thanks for your reply. How do I go about working with that data in the reposnse body without writing to flashvars, which I unfortunately do not understand?
Dave
FlashVars is explained on the Adobe site here: http://kb2.adobe.com/cps/164/tn_16417.html, it's not that hard. It's basically adding a <param tag in your HTML, after that you get the variables in your Flash movie.
Peter Kruithof
THanks for this Peter, I understand how flash can read this, but my problem is how to get these variables into the html file. That is the missing link for me. Could you advise that one please or a link to a sample. Many thanks.
Dave
That depends on your scripting language. If you're using PHP: `echo '<param name="FlashVars" value="foo='.rawurlencode($_POST['foo']).'">';`. You need to use a server-side scripting language though, can't do it with static HTML files.
Peter Kruithof
Thanks Peter. So the html page would need to be created dynamically with asp (I'm on a windows server)
Dave
Yes, I don't know how to handle posted data in ASP, but I'm sure it's very easy, just google it.
Peter Kruithof