Skip to main content
October 31, 2006
Question

POST TO JSP FROM IN FLASH

  • October 31, 2006
  • 2 replies
  • 265 views
i have the following form, works great in HTML.



<form action = " http://someExternalwebsite.com/authentication.jsp" target = "_self"
onSubmit = "window.current('','paradigm','width=800,height=600,resizable=yes,toolbar=no,menubar=no,location=no');">

<input type="hidden" name="failedurl" value="password.asp">
<input tabindex="text" name="UserId">
<br>
<input type="password" name="password">
<br><br>
<input type="submit" value="Login">
</form>



how can i get this into a flash?
i have a username,password, and okay button ready, created.

do i put take the values of user name and password, put them into variables, and post them with getURL() ?

HELP!!! i can almost cry. this has to be done soon.

Thanks in advance

Dan M.
This topic has been closed for replies.

2 replies

November 3, 2006
i'm pretty sure i'm doing it wrong, so its not working! :) i understand the code.

but there's still a difference between understanding and making it work.

where do i put that block of code you gave me? in an on(release) { } of the button?

i have it there and its not working. Documentation (and google) on loadvars didn't help much for my case.

Thank you for your reply. You're the only one that answered
Participating Frequently
October 31, 2006
To post a form like you want from Flash you just need to use the LoadVars class. Here is an example:

var send_lv:LoadVars = new LoadVars();
var response_lv:LoadVars = new LoadVars();
send_lv.failedurl = "password.asp";
send_lv.UserId = textfield_instanceName.text;
send_lv.password = textfield_instanceName.text;
send_lv.sendAndLoad(" http://someExternalwebsite.com/authentication.jsp", response_lv, "POST");

This will send you form post to the server script and then any response from the server will be return to the "response_lv" variable and usable by in Flash.

Do a search in the Help files for "loadvars" for more information and for security settings on crossdomain data transfers.

Good luck with your program.

Tim