Solved

XML string from Flash to ASP.NET

Posted on 2006-07-13
1
227 Views
Last Modified: 2010-04-03
can any experts show me the best approach(es) to send xml from a Flash file (example: a flash based user registeration form to submit first name, last name and email)  to an asp.net page (aspx).  Example please
0
Comment
Question by:musclejack
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
furmiga earned 500 total points
ID: 17106546
Hi there!

Do you really want a xml approach ?

I'm used to send vars to ASP.Net in the usual way:

IN THE FLASH

Make a button and give the instance name: my_send_button
make 3 imput fields with the instance name: first_name, last_name and email

Put this code in the frame:

// creates a new instance of LoadVars
var send_rec:LoadVars = new LoadVars()
// Creates a onRelease function for your button
my_send_button.onRelease = function()
{
      // Populate your LoadVars with the arguments you want to send to the ASP
      send_rec.first_name = first_name.text;
      send_rec.last_name = last_name.text;
      send_rec.email = email.text;
      // Now send the LoadVars to the ASP and Places the response in this same LoadVars
      send_rec.sendAndLoad("http://your_site_here/your_ASP_file",send_rec,"GET");
}
/* After send and recieve ALL variables (or at last tried to), the onLoad function
will be called (This will be automactly called when all done)*/
send_rec.onLoad = function(sucess:Boolean)
{
      // If all good
      if (sucess)
      {
             // This message will be generated by your ASP
            trace(send_rec.final_message);
      }
}

IN THE ASP.NET

<%@ Page Language="VB" debug="true"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Response.Expires = -1
        Response.AddHeader("Pragma", "no-cache")
        Response.CacheControl = "no-cache"
        Response.AddHeader("Content-Type", "text/html;")
        Dim first_name as String
        Dim last_name as String
        Dim email as String
        first_name = Request("first_name")
        last_name = Request("last_name")
        email = Request("email")
        if (first_name <> "") and (last_name <> "") and (email <> "") Then
            Response.Write("&final_message=Everything is fine&")
        else
            Response.Write("&final_message=One of the fields is blank&")
        End if
    End Sub
</script>

Well thats it. I hope it helps :)



Ralph
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question