# Flash to ASP

**URL:** <https://forum.kirupa.com/t/flash-to-asp/180713>\
**Category:** flash\
**Created:** [March 3, 2006, 12:03am UTC](https://forum.kirupa.com/t/flash-to-asp/180713 "2006-03-03T00:03:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oni\_J](https://avatars.discourse-cdn.com/v4/letter/o/ecb155/32.png) [@Oni\_J](https://forum.kirupa.com/u/Oni_J)\
**Post date:** [March 3, 2006, 12:03am UTC](https://forum.kirupa.com/t/flash-to-asp/180713/1 "2006-03-03T00:03:06Z")

</div>

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 👼 ).

I’ve looked over this tutorial [http://www.kirupa.com/developer/actionscript/forms\_database.htm](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…

```auto
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…

```auto
 
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!

---

<div class="post-metadata">

**Author:** ![jopiruizen](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jopiruizen](https://forum.kirupa.com/u/jopiruizen)\
**Post date:** [April 21, 2006, 10:51am UTC](https://forum.kirupa.com/t/flash-to-asp/180713/2 "2006-04-21T10:51:31Z")

</div>

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&

---

<div class="post-metadata">

**Author:** ![jopiruizen](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jopiruizen](https://forum.kirupa.com/u/jopiruizen)\
**Post date:** [April 21, 2006, 10:59am UTC](https://forum.kirupa.com/t/flash-to-asp/180713/3 "2006-04-21T10:59:17Z")

</div>

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](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
