|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
win nt 40 + apache::can't read php generated variables into Flash MX
Hello everybody!
This is my first message on this forum. I have the following problem: System: Win nt 4.0 service pack 6 Apache PHP MySQL Flash MX The problem: reading php generated variables from Flash The php script looks like this: PHP:-------------------------------------------------------------------------------- <? $result = $HTTP_GET_VARS['input'] +1; print "result=$result"; ?> -------------------------------------------------------------------------------- When I enter in the browser's address window the following address: <http://localhost/phpFile?input=100> In the Browser window appears: <result=101> So the php works fine with Apache! The next step would be to read the "result" variable into Flash, using the "loadVars()" method. This part doesn't work. What could be the problem? Win NT permissions? Apache settings? PHP .ini settings? I hope that somebody has the answer. |
|
#2
|
|||
|
|||
|
Quote:
none of the above. maybe you have to send a "\n" at the end of the string. i cannot remember, but i succeeded only after some tries too... how do you access the variable in flash? Can we have 2 lines of code from you (the line with loadVars() and the line where you want to work with the variable...)
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
|||
|
|||
|
I have this code in the first( and only) frame of the .fla file:
------------------------------------------------------------------------------ _global.input=100; lvObj=new LoadVars(); lvObj.input=_global.input; lvObjRec=new LoadVars(); lvObjRec.onLoad=function(){ _root.result_tf.text=this.result; } lvObj.sendAndLoad("http://localhost/myFlashPhpTest/process.php" + "?" + lvObj.toString(), lvObjRec); stop(); ------------------------------------------------------------------------------ note: _root.result_tf is a text field in the same frame. My php looks like this: ----------------------------------------------------------------------------- <? if(isset($HTTP_GET_VARS['input'])) { $result = $HTTP_GET_VARS['input'] +1; print "result=$result\n"; } ?> ----------------------------------------------------------------------------- How must I modify my php file? I have attached the files to this message. Please test them on your computer. |
|
#4
|
|||
|
|||
did they make a new script language for Flash MX? I only have Flash 5, but there is no predefined "LoadVars" object.i only have a "loadVariables()" command, that will be used like this: Code:
loadVariables("http://localhost/myFlashPhpTest/process.php?input="+String(_global.input), 0);
result_tf.text=result;
... are you running your flash inside the browser and on the same domain? you cannot do cross-domain access nor can you run the file from your harddisk. it has to be loaded from http://localhost too. |
|
#5
|
|||
|
|||
|
Try using
$_REQUEST instead of $HTTP_GET_VARS for some reason PHP does not pick up vars sent from Flash in a GET string using HTTP_GET_VARS. Its happened to me before. M. Hirsch I suggest you pick up MX, the new objects and event handlers blow the socks off 5. |
|
#6
|
|||
|
|||
|
Quote:
M. Hirsch he stated at the top he has Flash MX, most of the stuff you stated can be done in Flash MX including cross-domain stuff. And running it from your harddisk. Also your code probably will not work as expected since you need to detect when the variables have been loaded before you can assign the value of one to a text field. |
|
#7
|
|||
|
|||
|
ok, you convinced me that i need this MX too. On monday iŽll ask my boss
![]() |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Windows Help > win nt 40 + apache::can't read php generated variables into Flash MX |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|