Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Flash Variables to ASP

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 31-10-2009
Member
 
Join Date: May 2009
Posts: 640
Flash Variables to ASP
  

I do not know much ASP but I want to pass variables from a flash document to an asp, but I don't know how. I'm looking for help, I fall on transfer of variable from asp to flash and not the reverse. Is this correct? Can you help me how to transfer variables from flash document to ASP?

Reply With Quote
  #2  
Old 31-10-2009
Member
 
Join Date: Nov 2008
Posts: 996
Re: Flash Variables to ASP

To send variables from flash to a page (asp, php, .... it works like that), it must pass through the LoadVars object. This sends the data just like a simple html form would do.
Code:
var my_lv:LoadVars = new LoadVars();
my_lv.v1= myvariable1;
my_lv.v2 = myvariable1;
For sending data, you have the choice between open and send the result page directly (using send)
Code:
// send (can be POST or GET)
// here, sending POST and open the page in a new window
my_lv.send("mypage.asp", "_blank", "POST" );
Reply With Quote
  #3  
Old 31-10-2009
Member
 
Join Date: May 2009
Posts: 640
Re: Flash Variables to ASP

OK thank you, for it seems to work. But, once in my asp file how do I get my my_lv.v1 and my_lv.v2?

In php I managed to recover a $_POST ['myvar'], but in asp I don't know how to do.

I searched a lot and I get the code but its still not working:

in Flash:
HTML Code:
var my_lv:LoadVars = new LoadVars();
my_lv.v1= "myvariable";
my_lv.send("myasp.asp","_blank","POST" );
in the ASP:
HTML Code:
<%
 
Dim thename 
thename = Request.Form("v1" )  
response.write(thename)  
%>
I manage well on my asp page but I can not display the variable that I passed.
Reply With Quote
  #4  
Old 31-10-2009
Member
 
Join Date: Nov 2008
Posts: 996
Re: Flash Variables to ASP

Quote:
Originally Posted by CodGuru View Post
For sending data, you have the choice between open and send the result page directly (using send)
Code:
// send (can be POST or GET)
// here, sending POST and open the page in a new window
my_lv.send("mypage.asp", "_blank", "POST" );
or send and retrieve the result page in a variable actionscript (sendAndLoad)

Code:
// results in result_lv
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
// function called when the data sent by the asp page is LOADED
if (success) {
// data received
} else {
// in case of failure
}
};
// send POST
my_lv.sendAndLoad("mypage.asp", result_lv, "POST" );
I hope this answers your question
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Flash Variables to ASP"
Thread Thread Starter Forum Replies Last Post
What are the Predefined Variables in PHP? Leonard Software Development 5 27-02-2010 10:44 PM
What are the PHP Variables? shivendra Software Development 5 28-01-2010 06:05 PM
Replace variables in php John Wilson Software Development 3 04-12-2009 01:17 PM
Variables to use in many forms! RupaliP Software Development 3 19-02-2009 10:41 PM
KB923789 Flash fails - patch for flash v6.0 complains about Flash JG Windows Update 6 20-04-2007 11:44 PM


All times are GMT +5.5. The time now is 10:19 AM.