Results 1 to 4 of 4

Thread: Flash Variables to ASP

  1. #1
    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?

  2. #2
    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" );

  3. #3
    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.

  4. #4
    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

Similar Threads

  1. What are the Predefined Variables in PHP?
    By Leonard in forum Software Development
    Replies: 5
    Last Post: 27-02-2010, 11:44 PM
  2. What are the PHP Variables?
    By shivendra in forum Software Development
    Replies: 5
    Last Post: 28-01-2010, 07:05 PM
  3. Replace variables in php
    By John Wilson in forum Software Development
    Replies: 3
    Last Post: 04-12-2009, 02:17 PM
  4. Variables to use in many forms!
    By RupaliP in forum Software Development
    Replies: 3
    Last Post: 19-02-2009, 11:41 PM
  5. Replies: 6
    Last Post: 20-04-2007, 11:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,249,117.70302 seconds with 17 queries