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
Solved

XML string from Flash to ASP.NET

Posted on 2006-07-13
1
214 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stop Ads in Browser Google Chrome 3 547
Rotating Adobe pdf document 4 320
black magic design 1 130
Some You tube not working in IE11 on Windows 10 and 8.1 5 82
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

856 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