I would like to send data from asp.net to flash after a button click. I found some example using Response.Write. Maybe there is a better practice to do it? Here is my code for now:
in asp.net (vb):
Protected Sub Button1_Click1(sender As Object, e As System.EventArgs) Handles Button1.Click
Dim savebtn As String = "save"
Response.Write("save=" & savebtn)
End Sub
in flash:
var aspSend:URLRequest= new URLRequest("http://Cwiczenia.aspx");
var aspLoader:URLLoader = new URLLoader();
aspLoader.addEventListener(Event.COMPLETE, processASP);
aspLoader.load(aspSend);
private function processASP(e:Event):void
{
var loader:URLLoader = URLLoader(e.target);
trace("Response is " + loader.data);
if (loader.data == "save")
testN = 15;
updateTextFields()
Spontan23
Member
345 Points
314 Posts
send data to flash
Dec 27, 2012 09:26 PM|LINK
Hi All,
I would like to send data from asp.net to flash after a button click. I found some example using Response.Write. Maybe there is a better practice to do it? Here is my code for now:
in asp.net (vb):
Protected Sub Button1_Click1(sender As Object, e As System.EventArgs) Handles Button1.Click
Dim savebtn As String = "save"
Response.Write("save=" & savebtn)
End Sub
in flash:
var aspSend:URLRequest= new URLRequest("http://Cwiczenia.aspx");
var aspLoader:URLLoader = new URLLoader();
aspLoader.addEventListener(Event.COMPLETE, processASP);
aspLoader.load(aspSend);
private function processASP(e:Event):void
{
var loader:URLLoader = URLLoader(e.target);
trace("Response is " + loader.data);
if (loader.data == "save")
testN = 15;
updateTextFields()
}
PrashanthRed...
Member
559 Points
96 Posts
Re: send data to flash
Dec 27, 2012 10:02 PM|LINK
Hi Spontan23
Follow below link
http://www.kirupa.com/forum/showthread.php?360922-Passing-variables-from-asp-net-to-flash
Thanks,
Prashanth Reddy
Spontan23
Member
345 Points
314 Posts
Re: send data to flash
Dec 28, 2012 07:50 AM|LINK
Thanks PrashanthReddy, but is there a way to avoid flashcontrol?
PrashanthRed...
Member
559 Points
96 Posts
Re: send data to flash
Dec 28, 2012 12:38 PM|LINK
Alternative is to embed below object tag in aspx or html passing required parameters.
Thanks,
Prashanth Reddy