Page 1 of 1
grabbing Flash variables
Posted: Mon Dec 13, 2004 10:30 am
by Storm
Hey guys/girls,
I am having troubles getting PHP to grab variables from Flash with PHP 4.2.3 running on the server. I am using PHP to fopen and fwrite data to an XML file using variables from Flash. I have done it before on projects, but for some reason in the newest version of the Flash Player, it is not working. The PHP opens the XML file and writes all the data with no problem except the Flash variables aren't being written.
Has the interaction between PHP and Flash changed during the release of Flash's latest player? Is this a new security thing in how PHP is allowed to grab variables?
Posted: Mon Dec 13, 2004 9:59 pm
by Simon
Hi Storm...
Can you clarify a few things? PHP can't "grab" variables from Flash unless your Flash movie initiates. Are you doing a LoadVars() call or something to a PHP script? Is Flash not receiving the appropriate response back? Do you want Flash to receive the XML data, or a URL-type string? Perhaps you could do a getURL() call instead of a LoadVars() (both effectively GET or POST in the same way) but the former will allow you to see the PHP output in plain text.
< Simon >
Posted: Tue Dec 14, 2004 1:59 pm
by Storm
I can clarify, but no real need to because I have no problem calling the php file from Flash. I am using the loadVariablesNum command to call the php file and it writes the XML file just fine. The variables are the only thing NOT written into the XML from PHP though. I have done it before and can't figure out why it's not working now. I wanted to know if anything changed in regards to security settings.......now that it's Flash Player 7 and PHP 4.2.3 and that's it. If the answer is NO, then I need to check why the server isn't functioning. There's nothing wrong in the code. Neither loadVariablesNum nor LoadVars is passing the variables when the PHP file executes.
Posted: Tue Dec 14, 2004 4:46 pm
by Simon
Well to answer your primary question, I don't know about the security changes in Player 7 - I'm sure there probably were some upgrades, but I doubt they should stop you from loading variables.
As such I was trying to better understand your problem. I still don't understand what your script is supposed to return. I assume the XML data is written to a text file somewhere else, and a string of variables should be returned (a=100&b=200&c=300). The easiest way to debug what's being returned is by (a) use getURL() instead to check what PHP is outputting, and (b) Use the debugger in Flash to output the values of the variables to see if they've been parsed.
The ActionScript Dictionary doesn't mention any security issues regarding LoadVariablesNum()...
http://www.macromedia.com/support/flash ... ry426.html
< Simon >
Posted: Wed Dec 15, 2004 11:11 am
by Storm
Thanks for your help Simon......don't make it more complicated than it is.
A different Flash file loads the XML file and parses the information within it. I am working on the Flash admin part which tells PHP to write the XML file. It's really simple. I use it to write XML files all the time and this time it is not working. There must be something changed on the server. It has nothing to do with Flash except the fact that I am using Flash to organize the info PHP will use to write the XML.
Thread closed. Thanks.