First is using FileStream
filePath = File.documentsDirectory.resolvePath("sez_os_cisN.csv");
fS = new FileStream();
try{
fS.open(filePath,FileMode.READ);
}catch(err:Error){
trace("fs.open error "+err.message);
}
openTF.text = fS.readMultiByte(fS.bytesAvailable,"UTF-8"); //openTF is TextField
On PC works fine, on mobile shows nothing. String read from fS.readMultiByte(fS.bytesAvailable,"UTF-8") has 0 length
Second using URLLoader
filePath2 = File.documentsDirectory.resolvePath("sez_os_cisN.csv").nativePath;
myReq = new URLRequest(filePath2);
myLoader = new URLLoader();
myLoader.addEventListener(Event.COMPLETE, fileLoaded2);
myLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler2);
try
{
myLoader.load(myReq);
}
catch (error:Error)
{
trace("Just catched the error :(/>");
}
public function fileLoaded2(e:Event):void
{
openTF2.text = myLoader.data; //openTF2 is TextField
}
public function ioErrorHandler2(e:IOErrorEvent):void
{
openTF2.text = "There was a problem loading a " + filePath2 + " file: " + e;
}
Again on PC fine, on mobile shows error - #2032 (Some ioerror like it didn't find file)
I have third TextField where I write path to file and if it exist. On both mobile and PC it return right path and TRUE. Below screenshot from mobile
Does anyone know what could be problem and how to solve it? Thanks in advance

New Topic/Question
Reply




MultiQuote


|