I have a project with a bunch of external sounds to a SWF. I want to play them, but any time I attempt load a new URL into the sound object it fails with either,
Error #2068: Invalid Sound
or raises an ioError with
Error #2032 Stream Error
// Tried with path prefixed with ‘http://..’ ‘file://..’ ‘//..’ and ‘..’)
var path:String = 'http://../assets/the_song.mp3'; var url:URLRequest = new URLRequest( path ); var sound:Sound = new Sound(); sound.addEventListener( IOErrorEvent.IO_ERROR, ioErrorHandler); sound.addEventListener( SecurityErrorEvent.SECURITY_ERROR, secHandler); sound.load(url);
Well, I’ve just done a test by putting an mp3 in a directory:
soundTest/assets/song.mp3then creating a swf that calls the mp3 in another directory:soundTest/swfs/soundTest.swfand when I usevar path:String = '../assets/song.mp3';then it compiles with no errors.What is your actual directory structure?