Skip to main content
Participating Frequently
March 14, 2017
Question

Can't Link to a URL from FLA

  • March 14, 2017
  • 3 replies
  • 396 views

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,

This topic has been closed for replies.

3 replies

Participating Frequently
April 3, 2017

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.

kglad
Community Expert
Community Expert
April 3, 2017

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.

Colin Holgate
Inspiring
March 14, 2017

If you're just testing in Animate, try a debug test. Then you'll see the security errors that are going on.

Inspiring
March 15, 2017

Is this something to do with having to use https not http?

AIR 20.0.0.233 URLMonitor broken with iOS 9 ?

Participating Frequently
March 15, 2017

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.

kglad
Community Expert
Community Expert
March 14, 2017

assuming your html and swf are on pjrules.com, use a relative path to your php file, not absolute.

Participating Frequently
March 15, 2017

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.

kglad
Community Expert
Community Expert
March 15, 2017

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.