I faced this problem with Android but I solved! But in IOS it's not working and I spent more than 1 day tried to solve it. I traced everything in folder and its give me the path correctly but when I call the sound path to load it, it's keep give me this message.
this is the result of trace
/var/mobile/Applications/A121170F-40A0-4FF8-B93B-238D2B09C797/Documents/story1/zipFolder/mp3/1.mp3
1.mp3
/var/mobile/Applications/A121170F-40A0-4FF8-B93B-238D2B09C797/Documents/story1/zipFolder/mp3/2.mp3
2.mp3
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at buildPageAnimation::LoadAndSetAnimation/loadComplete()[D:\TestUnZipFile\Ipad-new methods for animations - unzip\src\buildPageAnimation\LoadAndSetAnimation.as:95]
at buildPageAnimation::LoadAndSetAnimation/loadComplete()
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at buildPageAnimation::LoadAndSetAnimation/loadComplete()[D:\TestUnZipFile\Ipad-new methods for animations - unzip\src\buildPageAnimation\LoadAndSetAnimation.as:95]
at buildPageAnimation::LoadAndSetAnimation/loadComplete()
and this is the code
var soundFile:File = File.documentsDirectory.resolvePath('story1/zipFolder/mp3/');
var files:Array = soundFile.getDirectoryListing();
for (var i:uint = 0; i < files.length; i++)
{
trace(files[i].nativePath);// gets the path of the files
trace(files[i].name);// gets the name
var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var lastPosition:Number = 0;
mySound.load(new URLRequest(files[0].nativePath));
myChannel = mySound.play();
}
I tried to but static path like this file:///C:/Users/MASTER/Documents/story1/zipFolder/mp3/1.mp3 and its not working Please There is anyone can help me with this.
mySound.addEventListener(IOErrorEvent.IO_ERROR, handler);this will sort the error thrown, but I think you have to find why it doesn't access it - path incorrect, insufficient access rights? - Lukasz 'Severiaan' Grela