Getting SWF file loading Error #2036 only few times
Copy link to clipboard
Copied
I have used the following code:
var loader:Loader = new Loader;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityError);
var swfUrl:String = "content/1-1-1.swf";
loader.load(new URLRequest(swfUrl));
this.addChild(loader);
function onLoadComplete(e:Event){
trace("swf loaded successfully");
}
function securityError(e:SecurityErrorEvent){
trace(swfUrl + " security issue." + e.text);
}
function ioError(e:IOErrorEvent){
var errorMsg:String = swfUrl + " not found." + e.text;
trace(errorMsg);
ExternalInterface.call("ErrorTracker", errorMsg);
// ErrorTracker sendimg for tracking that function I writeen in html page
// This error getting very few times not for all times.
// Getting mails with this message as: content/1-1-1.swf not found.Error #2036
}
All most every times it's running fine. Only very few time, I am getting Error #2036. And mostly this error comes with Window7 or Windows8.
It would be great help if any one can found out some reason why adobe flash player not not loading SWF file some times while the file is available on the same server.
Thanks,
Uday
Copy link to clipboard
Copied
that error typically occurs when navigating away from a flash-embedded html page before a load has completed.
you can use the close() method to prevent that error.
Copy link to clipboard
Copied
Thanks for your answer, unfortunately it's not helpful.
It's not away from flash-embed html page. and there is not close() method for loader displayObject. I am loading a external SWF file into main SWF file that's it.
Copy link to clipboard
Copied
close | () | method |
public function close():void
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Lite 4 |
Cancels a load()
method operation that is currently in progress for the Loader instance.
Related API Elements
Copy link to clipboard
Copied
Thanks for quick response.
Unfortunately the problem is not fixed after implementation of close(). As per my track record one thing I noticed that this issue happening only in Windows7 and 8 only very few times during the heavy traffic. And on windows XP it never throughing any error. Please let me know if you have any idea regarding the same.
Copy link to clipboard
Copied
what's the url where it's occurring and what do you do to make it occur?

Copy link to clipboard
Copied
I have exactly the same problem as you which accours at random try.
I already googled about 100 topics and didnt found working solution.
I already tried this simple solutions:
- check if path is correct - yes it is correct, coz error appears randomly (on few machines with Windows 7, on others not).
- check if file name is correct with case-sensitive - yes it is correct, coz error appears randomly (on few machines with Windows 7, on others not).
- use reference with Directory to avoid GC - no difference, error still appears.
- avoid cache with variable date timer in url - no difference, error still appears.
- clear all flash cache - no difference, error still appears.
- update your flash player - no difference, error still appears.
- check if flash has access to internet - yes it has, I tried to load other external file (different domain with allowed access) with success.
All computers use Windows 7 x86 with latest updates.
All computers uses the same flash versions.
Some computers keep getting this error for few days.
Other computers works fine in the same time.
Copy link to clipboard
Copied
This is a problem with Adobe Flash Player. Sometimes it's not able load the external file. I found some other way that reduced the errors.
You may use this code inside ioError() function:
var swfUrl:String = "content/1-1-1.swf?="+Math.random();
loader.load(new URLRequest(swfUrl));
That means you may load the swf file again by adding query string. Please let me know if it's helpful or not.

Copy link to clipboard
Copied
"- avoid cache with variable date timer in url - no difference, error still appears."
I already tried similar solution, but not in ioError function:
loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3&nocache="+new Date().getTime()));
I will check if this will make a difference, but I dont think it will in my case.
Difference between your and my case is, that if computer is not able to load file, then it is doing it on every try, and this happens few or more days.
Other computers dont have this problem on any try.
I am using official YouTube code, making many things in AS3 for years, so code is fine, just looking for a trick for this adobe bug that seems to exist in every version of Flash Player.
Copy link to clipboard
Copied
Thanks for message.
Overall both of us having the same problem. I am continuing keep eyes for this issue. I'll update you if I got some better solution for resolve this issue. Please don't forgot to update me if you get some solution for this issue.
These issue are coming mostly on heavy traffic on Windows7 and Windows8 users.

Copy link to clipboard
Copied
The only thing that I found if you didnt try, is to avoid GC with code like this:
var loaderReferences:Array = new Array();
var loader:Loader = new Loader();
loaderReferences[0] = loader;
// here goes rest of your code for loader
It didnt solve the problem in my case, but it did for some other people as3 code, so maybe for you too.
Probably today, one of computers with that problem will have total reinstall of Windows 7.
I suppose that it will solve problem for some time, but this is not the solution type that we are looking for.

Copy link to clipboard
Copied
One more thing.
How many Math.random tries you are doing with ioError function?
Are you doing it once or over and over?
If you are able to reduce number of errors with one try ioError, then maybe ioError with try global variable counter which would limit number of tries to lets say 10 and setTimeout with 2000 ms or less for another try would do this for you?
Copy link to clipboard
Copied
I tried it only once. Earlier I was getting more than 100 error mails but after implementing Math.random I am getting only around 5 - 10 mails only. Because external file is available so there will no any problem to call more than 1 time.
But this is big concern that file is available but flash throughing the ioError very few times only not all the times.

