AS3 Error #2044. Once dissmissed the app works fine - actionscript-3

I'm working in as3 and my code is producing an error: "Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed."
Other then the fact that the app is producing this error and interrupting users who have a the debug version of the adobe flash player the app works just fine, I "Dismiss All" errors and
I've been debugging the program, stepping through one line at a time, trying to see exactly what it's failing to load and I can figure it out. From what research I've done it seems like the error is caused by urls being wrong or resources not being present, but as I've said, the app works exactly as expected.
here is a link to the app if you have debugger version of flash you'll see when it happens:
http://www.playmatics.com/parents_connect/

Assuming you are loading files off a server, I would suggest looking for server errors on file requests as this could be the source of your problem.
However, you might still want to properly handle the event thrown by the player in order to avoid the error from being displayed:
var loader:Loader = new Loader();
loader.addEventListener(IOErrorEvent.IOError, handleIOErrorEvent);
var urlReq:URLRequest = new URLRequest('srcURL');
loader.load(urlReq);
protected function handleIOErrorEvent(event:IOErrorEvent):void {
trace('handleIOErrorEvent: ' + event);
}
Hope this helps.
UPDATE
Not related to your problem... two files appear as not found – 404 errors – on your server:
http://www.playmatics.com/parents_connect/history/history.js
http://www.playmatics.com/parents_connect/history/history.css

Related

Emerging Stream Error #2032 in Adobe AIR application on Mac OS Sierra, help needed

I'm trying to help out a client with an Adobe AIR application that suddenly stopped working on Mac OS Sierra. I haven't developed the app myself, so I am trying to do my best to solve the problem. It's essentially a Flex application written in Actionscript 3. When I was debugging I can see that I am getting the following error:
[ERROR] Error #2032: Stream Error.
The way the application works is that it first makes a web request to the server and gets an XML with a number of songs. No problem there.
After that the application downloads the first song in the XML result and starts playing.
When the first song starts playing the application then downloads the second song in the XML-list, when that download is finished it starts downloading the next one and so forth. The files being downloaded seems to be rather large, a couple of MB's.
So the first download works just fine, but all the other track downloads fails with Stream Error #2032. It seems I dont get any response headers from the failed requests, only the first one. I have a crossdomain.xml on the server.
This app works just fine on Mac OS X El Capitan and Windows, but with Sierra I am getting this error. The code is not that complex, it makes an API URL Request with an URLLoader and saves the file to disk. I have also tried using URLStream instead, same issue.
This is some of the code for example:
public function downloadTrack(track:Object, storeName:String, apiKey:String):void {
this.setCurrentTrack(track);
this.urlParameters.storeName = storeName;
this.urlParameters.keystring = apiKey;
this.urlLoader = new URLLoader();
this.urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
this.urlRequest = new URLRequest("/api/" + 'download/' +
this.currentTrack.id + "?time=" + new Date().getTime());
this.urlRequest.method = URLRequestMethod.POST;
this.urlRequest.data = this.urlParameters;
this.addEventListeners();
this.urlLoader.load(this.urlRequest);
}
private function loaded(e:Event):void {
this.fileData = e.target.data;
writeFile();
}
private function writeFile():void {
var filePath:String = this.currentTrack.md5 + '.ogg';
var cacheFile:File = this.downloadDirectory.resolvePath('.' + filePath);
this.fileStream.addEventListener(Event.CLOSE, saveReady);
this.fileStream.openAsync(cacheFile, FileMode.WRITE);
this.fileStream.writeBytes(fileData,0,fileData.length);
this.fileStream.close();
}
In the addEventListeners()-method, event-listeners for the URLLoader is added, and it's the urlloader that fires the IOError.
A weird thing that has happened twice is that the app suddenly starts to work as normal and downloads all of the files successively. Then after a couple of minutes it starts acting up again and nothing works. I am really having a hard time to understand where the error lies. I am no Adobe AIR/Flex-expert, so maybe you can point me in the right direction? I am pretty close to giving up on this one.
Thanks!
Try to change the destination, probably you don't have permissions to
write there.
Use the latest AIR SDK
Would be much better if you will share the project where it reproduced so I could check on my machine

Why am I getting Error #2032 in my Adobe Air application?

I am working on an Adobe Air desktop app. I am getting an Error (Error #2032) when attempting a back-end call using...
<mx:HTTPService id="xmlReadDownloadSizeObject"
resultFormat="xml"
result="xmlDownloadSizeResultEvent(event)"
fault="xmlDownloadSizeFaultEvent(event)"
public function askDownloadSize(xmlString:String):void
{
var xmlParam:XML = new XML("<files>" + xmlString + "</files>");
globaltotalSize = 0;
xmlReadDownloadSizeObject.url = mainDataURL + "downloadsize.ashx";
xmlReadDownloadSizeObject.method = "POST";
xmlReadDownloadSizeObject.contentType = "application/xml"
xmlReadDownloadSizeObject.send(xmlParam);
}
mx.rpc.events.FaultEvent
faultDetail "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:5800/downloadsize.ashx" errorID=2032]. URL: http://localhost:5800/downloadsize.ashx"
This error began happening when I changed the back-end call to a copy of the website application on my local machine (http://localhost:5800/downloadsize.ashx). I was initially calling the server directly (https://www.serverName.com/Marathon/).
I have been trying to figure this bug out for an entire day now and am near throwing my hands up in the air! If someone can offer some helpful insight, I would greatly appreciate it!
Let me know if you need some more information. Thanks
The operation took longer than usual so I changed the max execution time by setting...
import flash.net.URLRequestDefaults;
URLRequestDefaults.idleTimeout = 1200000; // or any amount of time in ms
It should also be noted that Only Adobe® AIR® content running in the application security sandbox can use the URLRequestDefaults class. Other content will result in a SecurityError being thrown when accessing the members or properties of this class.
See Adobe live docs
For folks that came here from Google search:
I have been getting error 2032 while installing an Adobe Air application because the filename provided was incorrect. So the second step while resolving the error would be to check the URL.

Error #2036: Load Never Completed. URL: http://airdownload.adobe.com/air/browserapi/air.swf

UPDATE;
I've managed to reproduce this problem explained below locally - by disconnecting the local machine and clearing the browser cache. So the real question is; how can you load the air.swf file from a machine that is not connected to the 'net ? Or is there another way to launch an AIR application from SWF?
I have an AS3 application that is trying to launch a AIR application - it starts by loading the AIR SWF object and finding the currently installed version. My problem is that the AIR SWF object won't load. My code currently looks like the following;
private function getInstalledVersion():void {
var airLoader_adobe:Loader = new Loader();
loaderReferences["airLoader"] = airLoader_adobe;
airLoader_adobe.contentLoaderInfo.addEventListener(Event.COMPLETE, function(event:Event):void{
airswf = event.target.content;
trace(new Date(), "-- contentLoaderInfo airswf loaded, status =", airswf.getStatus(), "; fetching currently installed version");
airswf.getApplicationVersion(applicationId, publisherId, updateInstalledVersion);
delete loaderReferences["airLoader"];
});
airLoader_adobe.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function ( event:IOErrorEvent ):void
{
trace(new Date(), "-- contentLoaderInfo IO_ERROR;", event.target, event.toString());
delete loaderReferences["airLoader"];
});
var context_adobe:LoaderContext = new LoaderContext();
airLoader_adobe.load(new URLRequest('http://airdownload.adobe.com/air/browserapi/air.swf'), context_adobe);
}
Now, this works just fine in my local development environment. And in the local test environments. But for reason it's failing with an IO_ERROR in the customer environment; I'm getting the following in the logs ...
Thu Oct 23 15:41:31 GMT+0100 2014 -- contentLoaderInfo IO_ERROR; [object LoaderInfo] [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2036: Load Never Completed. URL: http://airdownload.adobe.com/air/browserapi/air.swf"]
I'm at a bit of a loss as to what can be causing this as I just can't reproduce this error locally. I'm told AIR is installed (and if I uninstall AIR locally I get a different error from that shown). I know the PC doesn't have access to the internet, but again locally if I disconnect from the network it's not required.
The only thing I can think of is that there is a policy on the Windows PC that is somehow blocking the loading of AIR within my SWF application - but I've no idea what this could be.
Does anyone have any pointers as to what could be going wrong, here?
Thanks.
Hmm, just to make sure I'm understanding it right:
You're downloading the air.swf in an AS3 project? Why not compile an AIR project directly?
You're trying to download the air.swf on a machine not connected to the internet? Of course you can't download something from the internet if you're not connected?
What do you mean by "customer environment?" Are you saying it works on your computer but not your customer's? Or is it when you run on your own computer in "developer mode" and "customer mode?" What does that mean?
Have you tried downloading something else? Like a random image from a server? Does that have the same result?
Sorry to put these questions in an "answer," but I think it'd be too long for a comment. Let me know and maybe I can help figure it out

as3 error says "Stream Error", but when loaded manually it's there

I've looked in several other questions, but it just doesn't seem to explain my error.
The error i'm getting is "Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://plustg.com/v2/_inc/_swf/getSavedSelfy.php
at snapshot_fla::MainTimeline/frame1()[snapshot_fla.MainTimeline::frame1:20]"
When going to that URL, it does load. But somehow flash throws a stream error.
For reference, this is all there is on line 20: var selfyXMLLoader:URLLoader = new URLLoader();
And this is the rest of the code:
var selfyXMLLoader:URLLoader = new URLLoader();
var selfyXMLRequest:URLRequest = new URLRequest('http://plustg.com/v2/_inc/_swf/getSavedSelfy.php');
selfyXMLLoader.load(selfyXMLRequest);
selfyXMLLoader.addEventListener(Event.COMPLETE, loadSelfy);
Strange thing here is that when changing it to any other url on ANOTHER website, it will work.
Help would be great.
I think some authentication is needed to get the content of this page. I tried to access it and I was prompted with a login/password box and the message: “You need to be a beta tester to view this page.”
Maybe you've already authenticaded in your browser, that would justify the fact that you can access, but not the Flash.

Try Catch With Sound Element into Flash CS5-as3

Hi All—anyone has any idea why this code doesn’t work?
With other load [example image] work perfect with sound...no :(
mySoundURL = new URLRequest(var+".mp3");
mySoundURLDefault = new URLRequest("default.mp3");
try{
sound.load(mySoundURL);
}catch(e:IOErrorEvent){
trace("Can't load sound: "+e);
sound.load(mySoundURLDefault);
}
this is the error I’m getting:
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error
Thanks and good day!
You do not use try/catch with loaders. Here's what you do instead:
sound.addEventListener(IOErrorEvent.IO_ERROR, onIOErrorEvent);
sound.load(mySoundURL);
private function onIOErrorEvent(e:IOErrorEvent):void{
trace(e);
trace(e.message);
// ^ This will show you the file it tried to load and failed at
e.currentTarget.removeEventListener(IOErrorEvent.IOError, onIOErrorEvent);
e.currentTarget.removeEventListener(Event.COMPLETE, onComplete;
// ^ don't forget to clean up your listeners!
}
The reason for this is, as you've seen, the uncaught error does not tell you anything helpful, such as which sound failed to load, or what the URL you tried to contact was.
I think #Alexander Sobolev is on the right track with his first guess, based on the fact that you still get an error. Handling errors from loaders is just different than handling errors from synchronous code, and try/catch will not help you here.
If you want to try playing an alt sound on fail from the first one, you'd do that in the onIOErrorEvent function.
Other times you'd listen for IOErrorEvent are when using Loader to load a swf or image file
loader.contentLoaderInfo.addEventListener(IOErrorEvent....
Or a URLLoader
urlLoader.addEventListener(IOErrorEvent...
It is not much information in the post, i suggest to check following conditions:
1) Is your var+".mp3" a correct URI? Does it point to the existing file? Just try in the browser - should it find the file?
If you are pointing to the file in internet you should use notation like http://site.com/song.mp3
If you are trying to play a file on your hard drive you should use direct file address like C:/audio/song.mp3
2) If its ok with the URI than maybe file is not in mp3 format.
3) You can try to play with SoundLoaderContext like
var mySoundURL = new URLRequest(var+".mp3")
var context:SoundLoaderContext = new SoundLoaderContext(0, false);
snd.load(mySoundURL , context);