Skip navigation
DTshults
Currently Being Moderated

Submitting variables to an ASPX file WITHOUT opening new window

May 3, 2012 8:06 AM

Tags: #loadvars #sendandload

Hello,

 

I'm trying to submit some variables from my flash to an aspx page on a different domain which will handle them and put them in a database.  I've tried a number of options, but the only ones that have worked also result in a new window/tab being opened, and I am trying to avoid this. 

For example, I tried a loadVars with the sendAndLoad() function, but it did not work because the "load" portion requires the aspx page to be on the same domain as the swf- which it is not.

the send() function does not work either, because it requires you to specify a target (_self, _blank, etc) and that causes a new tab to open, or a redirection on the current page- both unacceptable, as I am trying not to interupt the user's experience on the page the swf is featured on.  send() does succeed in submitting the variables, at least, but as I said, it opens a new tab/redirects current tab.

 

One solution is to enable outside domains access on the server-side, but this is not ideal.  I'm hoping for a flash solution.  Any thoughts?

 

here's the code:

 

 

 

var dataLoader = new LoadVars();

 

var junkLV:LoadVars = new LoadVars();

 

junkLV.onLoad = function(success:Boolean) {

 

    if (success) {

 

        trace("We are in business.");

 

        greenLight_mc._alpha = 100;

 

    }

 

    else {

 

        trace("FAIL");

 

        redLight_mc._alpha = 100;

 

    }

 

};

 

 

dataLoader.firstname = firstName;

dataLoader.lastname = lastName;

dataLoader.email = emailAddress;

dataLoader.dest = destination;

dataLoader.sendAndLoad("url.aspx", junkLV, "POST");

 
Replies
  • kglad
    72,251 posts
    Jul 21, 2002
    Currently Being Moderated
    May 3, 2012 10:37 AM   in reply to DTshults

    is that pseudo-code?  if not, there should be no cross-domain issue.

     

    also, use "_self" in the send() method should not open a new window.

     
    |
    Mark as:
  • kglad
    72,251 posts
    Jul 21, 2002
    Currently Being Moderated
    May 3, 2012 12:07 PM   in reply to DTshults

    the code you showed does not call a cross-domain aspx file.

     
    |
    Mark as:
  • kglad
    72,251 posts
    Jul 21, 2002
    Currently Being Moderated
    May 3, 2012 1:31 PM   in reply to DTshults

    then you'll need to use a local domain file to call your cross-domain file or you'll need to use a cross-domain master policy and possibly policy file.

     
    |
    Mark as:
  • kglad
    72,251 posts
    Jul 21, 2002
    Currently Being Moderated
    May 4, 2012 5:55 AM   in reply to DTshults

    you're welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points