Hello, i’m totally confused about flash security. My goal is to stream a mp3 from my server’s local filesystem (which is not available from the web). I’ve tried using NetStream, but when I run the compiled swf off my server in a browser I get a security message:
2148 SWF file _ cannot access local resource _. Only local-with-filesystem and trusted local SWF files may access local resources.
private var musicURL : String = "file:///home/vermin/music/test.mp3";
connection = new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
connection.connect(null);
private function netStatusHandler(event : NetStatusEvent) : void
{
switch(event.info.code)
{
case "NetConnection.Connect.Success":
connectStream();
break;
}
}
private function connectStream() : void
{
stream = new NetStream(connection);
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
stream.client = new CustomClient();
stream.play(musicURL);
}