Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Click Here
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 11th, 2004, 08:18 PM
Jotunheim Jotunheim is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 13 Jotunheim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry Flash Form Data and Post

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?

Reply With Quote
  #2  
Old January 11th, 2004, 11:37 PM
timothye timothye is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Sweden/Sverige/USA
Posts: 134 timothye User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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

Reply With Quote
  #3  
Old January 11th, 2004, 11:58 PM
Jotunheim Jotunheim is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 13 Jotunheim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old January 12th, 2004, 08:51 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,375 Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 6414 Folding Title: Novice Folder
Time spent in forums: 2 Weeks 5 Days 11 h 40 m 11 sec
Reputation Power: 492
Facebook MySpace
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..
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #5  
Old January 12th, 2004, 05:09 PM
Jotunheim Jotunheim is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 13 Jotunheim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #6  
Old January 12th, 2004, 05:26 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,375 Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 6414 Folding Title: Novice Folder
Time spent in forums: 2 Weeks 5 Days 11 h 40 m 11 sec
Reputation Power: 492
Facebook MySpace
Hi, check this thread out. These revert to loadVars but you should try the "Request.Form("link") if it's POST, Request.QueryString("link") if its GET" bit first in your asp file. Are you sure your using the correct value reading method for post?

Reply With Quote
  #7  
Old January 12th, 2004, 05:40 PM
Jotunheim Jotunheim is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 13 Jotunheim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #8  
Old January 12th, 2004, 05:57 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,375 Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 6414 Folding Title: Novice Folder
Time spent in forums: 2 Weeks 5 Days 11 h 40 m 11 sec
Reputation Power: 492
Facebook MySpace
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")

Reply With Quote
  #9  
Old January 13th, 2004, 01:04 AM
Jotunheim Jotunheim is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 13 Jotunheim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash Form Data and Post


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway