For example, in local network, when Adobe Air is reading files from local server (\\Server\storage\
) and network will be in down for a second, Air becomes eat a lot of memory and it is increasing up to 1GB (while normal memory use is 100 kb or less).
Just reading f开发者_如何学Goile with File('file path on local server');
from unstable network can cause this error.
Have anybody seen that in projects?
private function init() : void
{
file = new File("\\Server\dragracing\results.txt");
fileStream = new FileStream();
fileStream.addEventListener( Event.COMPLETE, fileComplete );
fileStream.openAsync( file, FileMode.READ );
}
private function fileComplete( event : Event ):void
{
fileContents = fileStream.readMultiByte( fileStream.bytesAvailable, ISO_CS );
.....
}
]]>
Have you tried closing the FileStream in the fileComplete method? Call the close method to make that happen.
private function fileComplete( event : Event ):void { fileContents = fileStream.readMultiByte( fileStream.bytesAvailable, ISO_CS ); fileStream.close(); ..... }
Also, based on your code it does not appear that you are ever actually reading information in from the file. from the file; so it is not clear the complete method will ever execute. There are plenty of methods used to read information in using the FileStream class.
精彩评论