Copy link to clipboard
Copied
This used to work but it no longer works. Very frustrating. If I paste the URL from the code below into a browser, it works. However, if I run this as a SWF file, it doesn't work. You need to wait for the default time out and you'll eventually get an IOError 2032. A few weeks ago this worked and I have four previous projects packaged as AIR for Android and AIR for iOS and it worked. I don't know why it's stopped working.
Here's the code:
var fname = "Mac";
var lname = "Donald";
var email = "mac@farm.com";
var baseURL = "http://www.pjrules.com/litnip/";
var post = baseURL + "newlogin.php?fname="+fname+"&lname="+lname+"&email="+email;
var urlLogin:URLRequest = new URLRequest(post);
var urlLoadLogin = new URLLoader(urlLogin);
urlLoadLogin.dataFormat = URLLoaderDataFormat.VARIABLES;
urlLoadLogin.addEventListener(Event.COMPLETE, loginData);
urlLoadLogin.addEventListener(IOErrorEvent.IO_ERROR, IOErrorHandler);
function loginData(e:Event): void {
var uid = urlLoadLogin.data.result;
trace("In loginData and uid = " + uid);
}
function IOErrorHandler(e:Event): void {
trace("Error: " + e);
}
I sent a similar request two weeks ago but there's been NO response. Sure could use some big brains to help out here.
Cheers,
Copy link to clipboard
Copied
assuming your html and swf are on pjrules.com, use a relative path to your php file, not absolute.
Copy link to clipboard
Copied
Right now I'm running it on my desktop but eventually it will be a mobile app. I have made a test file and I got it to work but the main app won't work. The code is the same.
Copy link to clipboard
Copied
test on a mobile.
you're going to waste time fixing a security issue that won't exist or will be different when you move to mobile testing.
Copy link to clipboard
Copied
If you're just testing in Animate, try a debug test. Then you'll see the security errors that are going on.
Copy link to clipboard
Copied
Is this something to do with having to use https not http?
Copy link to clipboard
Copied
Thank you Yachts9999.
It was working with HTTP before. I now know that the firewall at work will prevent my app from talking to the server. However, at home it won`t insert a record. I have made a test file that will insert a record but it`s the same code as my main app file and it doesn't work. Still digging into it.
Copy link to clipboard
Copied
Thanks Colin. I have tried it in debug mode. No other information came back. I did figure out that I can not connect at work because of a firewall but I can connect at home. However, there's no error at home but there is no updating of the database file. I'm starting to think that it may be my PHP coding now. I'm looking into that.
Copy link to clipboard
Copied
Thank you all for your feedback. I have pushed this to a mobile device and made sure I had the appropriate permissions on the device (manifest XML file settings). Still no luck. What really bothers me is that it was working and then on March 3rd it stopped working. The code works in other apps and in the test file I created. So what's wrong with my master file? I'm baffled. I may end up rebuilding the master file and just copy the key frames over. I'm hoping to avoid a rebuild though and would like to know a solution. Grrrr.
Copy link to clipboard
Copied
your code looks like it works for me. your uid is 65 and when i send other user names the uid increments as expected if the names are being added to a database.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now