IT Community - Software Programming, Web Development and Technical Support

Sending and Receiving values between Flash and .NET(sendAndLoad)

This is a discussion on Sending and Receiving values between Flash and .NET(sendAndLoad) within the Flash Actionscript Programming forums, part of the Web Development category; Sending and Receiving values between Flash and .NET Data transfer between Flash And .Net Sending And Receiving data between flash ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Flash Actionscript Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-17-2007, 12:23 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Sending and Receiving values between Flash and .NET(sendAndLoad)

Sending and Receiving values between Flash and .NET


Data transfer between Flash And .Net Sending And Receiving data between flash and asp.net.

To do this we must use SendAndLoad object in flash.

Syntax:
myLoadVars .sendAndLoad( url , targetObject [ ,method ] )

Parameters:

loadVarsObject The LoadVars object to upload variables from.

url The URL to upload variables to.

targetObject The LoadVars object that receives the downloaded variables.

method The " GET " or " POST " method of the HTTP protocol.

Description
Method; posts variables in the myLoadVars object to the specified URL. The server response is downloaded, parsed as variable data, and the resulting variables are placed in the targetObject object. A sample demonstration is given below

1) Create a Flash Document.
2) Create two textboxes and give instance name as "input_txt", "output_txt".
3) Create a button and give its name as "btnSendAndLoad".
4) Write the following codes in the Main Timeline.

var myLoadVar:LoadVars=new LoadVars();
var outputData:String;
var inputData:String;
btnSendAndLoad.onRelease=function(){
var result_lv:LoadVars=new LoadVars();
result_lv.onLoad=function(Sucess){
if(Sucess){
output_txt.text=result_lv.outputData;
}
}
myLoadVar.inputData=input_txt.text;
output_txt.text="Loading...";
myLoadVar.sendAndLoad("transfer.aspx", result_lv, "GET");
}
5) Create a web project in asp.net and embed the swf file in the default page.


6) Create another page called transfer.aspx in the same project and copy the following code in the page load event.

protected void Page_Load(object sender, EventArgs e)
{
string outputData = "";
outputData = Request.QueryString.Get("inputData");
Response.Write("outputData="+outputData);
}

6) Place all the files in server and run it.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-17-2007, 03:10 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Sending and Receiving values between Flash and .NET(sendAndLoad)

Hi,

This is a good one. But this is like calling the server side script from flash. We can apply the same method to call any type of server side scripting like asp.net, Coldfustion PHP etc. Do you know one thing, instead of calling the server side file, flash has given the option to call the server side webservices. This is also a good concept to call the server side functions alone not the full program file.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Transfer using XML.sendAndLoad and PHP oxygen Flash Actionscript Programming 2 03-15-2008 02:57 AM
How to attach file when sending a mail via flash form? aramesh Flash Actionscript Programming 1 03-07-2008 01:55 AM
Sending message to mobile using php saravanan PHP Programming 6 01-02-2008 12:05 AM
"POST" large amount of data using SendAndLoad (Exporting JPG/JPEG) aramesh Flash Actionscript Programming 2 12-28-2007 02:42 AM
Sending SMS through ASP.Net S.Vinothkumar ASP and ASP.NET Programming 12 09-17-2007 05:29 AM


All times are GMT -7. The time now is 07:03 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0