AS3 URLoader and Firefox Problem

Has anybody encountered a problem with using URLLoader in Firefox?

I have a Flash movie that uses URLLoader in a completely standard way and while it is perfect in IE and Safari, it is highly intermittent in Firefox!

Firebug shows me that it always calls the url but only 50% of the time does it result in a successful load of the data from it!

The code is below but I doubt it will tell us much. Has anybody encountered this before as a known issue?
// Gain external access to data
urlLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
			urlLoader.addEventListener(Event.COMPLETE, onDataLoaded, false, 0, true);

urlLoader.addEventListener(Event.OPEN, onDataOpen, false, 0, true);
			urlLoader.addEventListener(ProgressEvent.PROGRESS, onDataProgress, false, 0, true);
			urlLoader.addEventListener(IOErrorEvent.IO_ERROR, onDataError, false, 0, true);
			
urlLoader.load(new URLRequest(*** DELETED URL ***);

Open in new window

LVL 6
courtthreeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CyanBlueCommented:
I develop on Firefox with Firebug, so it's somewhat hard to think that this is the Firefox specific issue...  Can you do a quick test with other URLs rather than the one you are having trouble with???

CyanBlue
0
courtthreeAuthor Commented:
Hey Cyan, you are right - I doubt it's a Firefox only issue but it only manifests in FF. IE and Safari are fine with it. Here's an example URL: http://bdo.scripthandler.com/templates/default.aspx?uid=4

9 times of 10 when you hit it the first time, it will load OK. But try refreshing it. After 1 or 2 refreshes you just get the "WAITING FOR DATA" text in the header which means that it never fired the complete event after getting the data.

Take a look - see what you think.
0
CyanBlueCommented:
I briefly see that red text that says waiting for data which goes away eventually and displays the site...  I am thinking that is the part of the preloader, and maybe there is some problem where it is calculating when the site is fully loaded...  That's my initial hunch on this, but I don't know what else I can say cuz I don't have any other info...

If this is your site, I suggest you do a quick test assuming that this is the preloader issue...
Create a new FLA file and have it preload the dummy SWF(s) into it, and display 'DONE' when you detect the files are fully loaded just like you did in that site...
Now, test that file in multiple browsers and see if you see the same problem...  If you do, now you know where to look for...  ;)

CyanBlue
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

courtthreeAuthor Commented:
Thank you so much for getting involved Cyan.

Are you saying that the "WAITING FOR DATA" versions load eventually on your system? They don't on mine.

I am a building a test file now that imports the same data stream so I can eliminate all the other things that are going on.

What do you make of the fact that the swf appears twice in the download list in firebug?
0
CyanBlueCommented:
Yeah, I do see two calls for default-1.swf if that indeed is the file you are having problem with...  I don't know why it is making two calls though...  I am sure you will learn more about it when you create a tester version of it...  Please keep me posted...  ;)

CyanBlue
0
courtthreeAuthor Commented:
I have a tester now at: http://bdo.scripthandler.com/templates/ff/

"STAGE 4" denotes that the load is complete. The output after that is text from the script. This works perfectly every time.

I am lost.
0
CyanBlueCommented:
Yeah, that's weird...  I do see two calls for ff.swf in that sample though...

What's your math/code to compare whether the SWF is fully loaded???  Can you trace what's been downloaded and what the total file size is???

CyanBlue
0
courtthreeAuthor Commented:
Very straightforward:
private function monitorLoading(evt:ProgressEvent):void {
			
			var pcent:Number = evt.bytesLoaded / evt.bytesTotal * 100;
		
			if(pcent==100) {
				onSiteLoaded();
			}
		}

Open in new window

0
CyanBlueCommented:
Can you do a trace on the pcent on both cases and see if both are the same or not???

CyanBlue
0
courtthreeAuthor Commented:
Well, here's the weird part.

My trace of the data shows three different outcomes:

1. The URLLoader doesn't even start
2. It starts but sticks at fully loaded (i.e. 6000 bytes loaded out of 6000 bytes)
3. It loads normally as expected.

Again, the random behaviour is nearly always in REFRESH...
0
CyanBlueCommented:
What if you do (evt.bytesLoaded >= evt.bytesTotal) instead of checking 100???

CyanBlue
0
courtthreeAuthor Commented:
Hi mate,

This loader is the pre-loader and the movie can't run without it so we know it's solid.

The URLLoader listeners are as per my first post.
0
CyanBlueCommented:
I ain't got a clue on why that's happening...  :(

CyanBlue
0
courtthreeAuthor Commented:
Well, I have around 12 hours to find the reason!!!

ANY thoughts are welcome!!!
0
courtthreeAuthor Commented:
Hey Cyan,

I thought I'd update on the ACTUAL PROBLEM and it's solution!

It turns out that the custom class I used for the data access was being instantiated inside a function. This gave it a certain impermanence that allowed our old friend the GARBAGE COLLECTOR to kill it.

The red herring of it being an FF problem emanates from the fact that, unknown to me, GC behaves differently in different browsers!

The function-based instantiation of a class is a bit of a rookie mistake but I definitely didn't see the GC's variable behaviour across browsers (on the same system) as a known issue.

Thanks for your help and your immediate, frequent responses. It's always appreciated and demonstrates why you the top rated expert on here.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CyanBlueCommented:
Yeah, the Flash Player on different browsers behave abit differently whether Adobe likes it or not...  Generally speaking, those differences are not a major ones...  I have never heard of problem with GC behaving differently on different browsers...  
It'd be great if you can create a simplest sample that shows the problem and post it to Adobe bug list so that they can take a look to see if they can improve it on the next patch...
   http://bugs.adobe.com/jira/

But, none the less, I am just glad to hear that you find the solution...  Such bug is not an easy one to find...  ;)

Thank you, but I am only doing what I can do and I am sure other experts are doing the same to help others...  Oh, please accept your comment as a solution to close this topic...  Thanks...

CyanBlue
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.