|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi All
Hope someone out there can help me, this is driving me crazy!! ![]() I am trying to load variables from a text file into Flash and then send these to PHP, when I debug the Flash movie the variables show as loaded, but they are not sent to the PHP file. If I create a variable and give it a value like this container.test="10"; it works and this variable 'text' is send to my PHP file. What am I doing wrong, as the variables in my textfile are not sent? Here is my code below: Here is the code in my text file: &id=5&aff_name=testing Here is the code in my Flash Movie: container = new LoadVars(); container.load("c:\\notepad.txt",0); container.sendAndLoad("flash_test.php",container,"POST"); Here is the code for my PHP file: (database connect code here) $sql = "INSERT into flash_test values( null, '$id', '$aff_name' )"; mysql_query($sql,$dbh); echo "various variables here": this part works. |
|
#2
|
||||
|
||||
|
container.load("c:\\notepad.txt",0);
you can do *this* with actionscript?? christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
|
#3
|
|||
|
|||
|
as far as I am awear yes as c:\notepad.txt did not work and it chopped out the n from notepad.
|
|
#4
|
|||
|
|||
|
aff?
your string in textfile 'text.txt':
&id=5&aff_name=testing this should fetch out the string and split it into key-value pairs, then assign these values to the textboxes, id and aff_pairs, respectively: loadText = new loadVars(); loadText.load("text.txt"); loadText.onLoad = function() { id.text = this.name; aff_name.text = this.email; }; the file you are accessing has to be on the webserver. you cannot access local files with actionscript (yet, although there are plans). i'm unsure whether your textfile is in the same place you have published your swf. it could also be something to do with the way you were using the same loadvars object to send AND receive your data. you should use 2 separate objects for this in future. by the way, there's quite a neat tutorial on the subject with our friends at kirupa: http://www.kirupa.com/developer/mx/externaldata.htm hope this helps. ps: is aff_pairs anything to do with accelerated free-fall? enquiring minds want to know! e Last edited by 1ain : July 29th, 2003 at 12:12 PM. |
|
#5
|
|||
|
|||
|
Thank you, for your help and pointers, it is now working!!!!
Not sure what you mean by aff_pairs, but its not anything to do with accelerated free-fall. Thank you again. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Flash variables to PHP, do not load. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|