Does anyone have any experience in reading a live text file?
I’m trying to read a text file that’s written with fmCreate or fmShareDenyNone rights.
I’ve written a bit of code (below) that works locally on my computer but when inside the CasparCG Client, it throws a #1014 error (class could not be found). The project has an AIR 2.5 target with ActionScript 3.0.
function update() {
var file:File = File.documentsDirectory;
file.resolvePath(path);
if (file.exists) {
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.READ);
var fileText:String = fileStream.readUTF();
var rawText:Array = new Array();
rawText = fileText.split("\n");
for(var i:int = 0; i < rawText.length; ++i){
var tempArray:Array = new Array();
//Split Identifier and Data
tempArray = rawText[i].split("=");
//Place Data into parsedText Array
var data:String = String(tempArray[1]);
if (isSubstring){parsedText[i] = data.substr(begin, (data.length - end));}
else{parsedText[i] = data;}
}
updateFields();
}
}
Any help would be greatly appreciated! Thanks so much!