Forum Moderators: open
I've used AS1.0 script that works perfectly if I publish to Flash 6/AS1.0, but seems to do nothing when I publish to Flash 7/AS1.0. Flash creates the LoadVars object fine, but it won't even try to sendAndLoad.
A trimmed down version of my code is:
dataReceiver = new LoadVars();
dataReceiver.onLoad = function(success) {
trace("RESPONSE RECEIVED!");
};
datasender = new LoadVars();
datasender.myvar = "This is the var I'm sending";
dataSender.sendAndLoad("http://www.mydomain.com/myscript.php", dataReceiver, "POST");
If you run cut and paste this code into Flash MX 2004 and publish to F6/AS1.0, you'll see RESPONSE RECEIVED! traced to the screen when Flash attempts to sendAndLoad but can't find the server. Now publish to F7/AS1.0 and you won't see the trace...
Any help greatly appreciated!
My first attempt, I created both my stub v7 swf and my loaded v6 swf in MX 2004. That didn't work, since I discovered that the v7 swf refused to load the v6 swf.
My second attempt, I created the v6 swf in Flash MX (not 2004). This time, my v7 swf loaded it fine, AND I was able to successfully call the sendAndLoad!
I'm not sure how clear that description of my workaround is, but perhaps someone else may find it useful if they encounter the same problem!
BTW, in case anyone is wondering why I'd be working in Flash 7 using AS1.0, it's because I want to alias embedded fonts, but I haven't gotten around to switching all my scripts to AS2.0 yet ;)
But if anyone can explain to my why the sendAnLoad wouldn't work to begin with, I'd love to know!