|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I've got a problem with Flash posting form data and I'd really appriciate it if someone could help, I've been fighting with it for way too long.
When I attempt to post form data to a page, Flash passes in zero length strings and I don't get what I need- on(release){ FormData = new LoadVars(); Formdata.FlashTestValue = FlashTestValue Formdata.send([PageURL], "_self", "POST"); } If I change the variables to static values it works, but I'm trying to get form data, e.g. if I replace line 4 with: Formdata.FlashTestValue = "TEST VALUE" The data gets through. Does anyone have any suggestions? |
|
#2
|
|||
|
|||
|
so is it working this way then ..
because you say its working one way and not the other ..use the 1 that is working ..i really dont understand so well ..can U explain more ..ill try and help ... cheers |
|
#3
|
|||
|
|||
|
The post operation works with a static value, e.g.:
Formdata.FlashTestValue = "TEST VALUE" This is no good for gathering form input though, when you need to use a variable that is linked to an input field. As soon as I change that line to read: Formdata.FlashTestValue = frmInputValue; The post operation sends a zero length string and I don't get the value that the user input. I've set a watch on the variable value 'frmInputValue', and it does get it's value correctly to what a user enters, but it is not correctly posted to the server. |
|
#4
|
|||
|
|||
|
Hi, try moving the loadVars out of the button and just call it from there i.e.:
Code:
//say in _root
FormData = new LoadVars();
on(release){
_root.Formdata.FlashTestValue = FlashTestValue;
_root.Formdata.send([PageURL], "_self", "POST");
}
If you give the form components variable names you can just get those in your server script i.e. if you have an input text box with the variable name of "myText" (no quotes) then you can modify the above to: Code:
//say in _root
FormData = new LoadVars();
on(release){
_root.Formdata.send([PageURL], "_self", "POST");
}
Any variables you have defined in flash will be posted to the target URL..so in your SS you will receive myText and be able to use it that way. I havent tried this with .send I dont think, works with getURL. Theres something else nibbling in my mind but I cant remember it right now.. |
|
#5
|
|||
|
|||
|
I've converted it to use getURL and this seems to work great, but it only works in test mode. Once I embed the flash into a web page and post from there, it fails once again...
I'm using an ASP script that dumps out both the Forms and Querystring collections for testing, posting from test mode shows all the variables as expected, posting from within a web page shows both collections to be empty... BTW, thanks all for your help. |
|
#7
|
|||
|
|||
|
I've tried getting both querystring and form values, e.g.:
Request.QueryString("Value") Request.Form("Value") Neither gets any data, I've also tried the method in the thread you posted, no dice there either. What's really odd is that it works fine in test mode, is there something I need to change once I've embedded it into a web page? |
|
#8
|
|||
|
|||
|
Hi, humm didnt think so. Ok what about frames? Are you using frames...
Just to clear this bit up are you sure your reading the correct vars in asp? So far we've talked about 3 different ones... Value FlashTestValue (2 diff ones of this) frmInputValue When you switched to using getURL did you also switch the variable name you were trying to read? I'm guessing "Value" was just an example for the last post..what happens if you try: Request.Form("frmInputValue") |
|
#9
|
|||
|
|||
|
Ok, got it working everything is peachy, well not everything but that's a different topic.
Thanks for your help. I'm not entirely sure what the problem was with all my tinkering, but this works: formdata= new loadvars( ); formdata.[Variable]=[Variable]; getURL[[URL], "_self", "GET"); Now I think I'm hitting an upper limit on how much you can post to a querystring, so I need it posting to the forms collection. I'll start a different one on that though, thanks for your help. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Flash Form Data and Post |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|