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");
Thanks for the reply-
That's the actual code, though not all of it. The sendAndLoad, for example, is actually inside an onRelease() for a button.
Also "_self" is still no good because it causes the current page to be redirected. I don't want any interuption of the page the flash is featured on at all.
Oh I'm sorry now I understand why you were asking. the "url.aspx" is not the actual URL. It will be a full url in the form http://www.domain/directory/file.aspx, which will indeed be on another domain.
Sorry for the confusion.
North America
Europe, Middle East and Africa
Asia Pacific