I have another problem with an acrionscript swf file. I'm reading some text from a CSV file. I create the fla file and when I test it in the animate editor it works and I can see all the text inside the CSV file into a TextField. If I export the .swf and run it with Adobe Flash Player 11.4 r402 I can't see the text that there is in the CSV File. I created this fla file made up of one photogram in which I wrote this code:
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.filesystem.*;
import flash.text.TextField;
var pathToFile:String = File.applicationDirectory.resolvePath('ex.csv').nativePath;
var requestedFile:URLRequest = new URLRequest(pathToFile);
var myTextField:TextField = new TextField();
myTextField.autoSize = TextFieldAutoSize.LEFT;
var documentLoader = new URLLoader();
documentLoader.addEventListener(Event.COMPLETE, onload);
documentLoader.load(requestedFile);
function onload(evt:Event):void
{
myTextField.text = evt.target.data;
addChild(myTextField);
}
I get this error if I try to open the swf file in a broswer:
SecurityError:[SecurityErrorEvent type ="securityError" bubbles = false cancelable = false evenPhase=2 text="Error#2048"
How can I make the .swf file work? Is there a way to read data from a CSV file into a .swf file?
Thank you to everybody!