Getting error while using string value got from db and used it for file path in AS3
In my ActionScript project i'm getting error while using string value got from db and used it for file path
var j:uint=0;
var xml:XML = new XML(DecryptXMLFile(GetXMLFilename(bookPath)));
ReadXMLData(xml);
private function GetXMLFilename(dirLocation:File😞File
{
var xmlFile:File;
var list1:Array = new Array();
var dirList:Array = dirLocation.getDirectoryListing();
for (var i:uint = 0; i < dirList.length; i++)
{
if (GetExtensionFromNativePath(dirList[i].nativePath) == "xat")
{
if(j==0)
DataManager.getInstance().sqlInsert( dirList[i].name, "R");
else
DataManager.getInstance().sqlInsert( dirList[i].name, "NR");
j++;
}
}
var path:String = DataManager.getInstance().getData().toString();
trace (path);
xmlFile = path;
return xmlFile;
}
private function DecryptXMLFile(file:File😞String
{
//Decode base64 string to png image
}
DB output is 0.xat
Error it shows as,
TypeError: Error #1034: Type Coercion failed: cannot convert "0.xat" to flash.filesystem.File. at com.reader::Reader/GetXMLFilename()
Even I changed the code as,
xmlFile= new File(path);
doesn't helps