Flash to ASP

Oni J. here, long time visitor, first time poster. :beam:
In fact I just registered right now to ask this question. :d:

Hello, I need to figure out how to send a value that a user inputs into
a dynamic text box(using flash) to an ASP file. The asp file then connects
with a databse(I’m assuming) and is suppose to show a page with results
relating to the inputted value.

Example: A post code is entered into a dynamic text box(in flash), then
when submitted, an asp page is loaded, showing locations near the postcode.

The code to search the database is already set in the asp. It use to work
using a html form, but I have to try and make a flash equivalent that can
be put into a banner ad, but give the same results.

I’m rather inexperience in ASP, as well as many of the advanced functions
of actionscript, since I mainly do front end flash work with minimal coding
(usually when I get into trouble, or need to figure something out I check out this site :angel: ).

I’ve looked over this tutorial http://www.kirupa.com/developer/actionscript/forms_database.htm

I named my dynamic text with the variable name I think the ASP file uses
and tried using…

on(press){
getURL("[http://yourSite.com/processForm.asp",0,"post](http://yoursite.com/processForm.asp)");
}

…exchanging the name of the asp url with the one I’m suppose to be using of course.
This doesn’t seem to be working. It opens the asp page, and shows
all the records of the database, not ones which are specific to the inputted value.

I also tried this…

 
on(press){
loadVariablesNum("[http://yourSite.com/processForm.asp",0,"post](http://yoursite.com/processForm.asp)");
}

But that doesn’t open the asp url at all, so I dont know if it’s working.

I know that this is rather a vague question, with many unknowns,
(I myself was a bit disappointed with how little info I was given)
but I hope someone can help me out. Thanks in advance!

Here’s the best way on sending and getting value to asp…

use

LOadVars…

How

var LV:LoadVars = new LoadVars();
var myInVar:String;

LV.onLoad = function(Success:Boolean){
if(Success){
myInVar = LV.myAspVar;
}
}
LV.myAspVar = AnyVarToBeSubmitted;
LV.sendAndLoad(“Myasp.asp”, LV, “POST”);

/---- Asp Script—

<%
response.write("&myAspVar=ANythingShouldBePlacehereEvenDatabaseFields&");

%>

Remmember U need to make a URL encoded string to be fetch in flash…

WHat is URL ENcoded

&VarName=Value&

What if you have multiple value to be Fetch?

Here’s what to Generate a asp script that will get all those value in one url encoded string…

— ASP Script
<%
UserName= "&UserName="
Do while not MyRS.EOF <---- i don’t know if this syntax is correct
if MyRS.EOF Then
UserName = UserName & MyRS(“UserName”) & "&"
else
UserName = UserName & MyRS(“UserName”) & “,”

End if
MyRS.movenext
Loop

Response.write(UserName);
%>

flash Action Script Fetch By Flash

var UserName:Array = new Array();

LV.onLoad = function(Yup:Boolean){
if(Yup){
UserName = LV.UserName.split(",");
}
}

and you got it… If you want to know if it is really working

visit

http://users.domaindlx.com/jopiruizen

and sign up or post something in my experimental forum, I used Flash And ASP to Send and Load Data to a Database

I hope I help you…

Good Luck