includes/audio/bird.mp3 is bundled up with the app.
var file:File = File.applicationDirectory.resolvePath("includes/audio/bird.mp3");
trace("file",file.exists);
trace("file",file.nativePath);
trace("file",file.url);
outputs
file true
file
file app:/includes/audio/bird.mp3
CodePudding user response:
This is expected.
Files packaged in the applicationDirectory
are compressed as part of the APK and don't have a direct file system path. You will need to extract them to an accessible location, (applicationStorageDirectory
).
In AIR simply copy the File
reference to the File.applicationStorageDirectory
and then you should have a native path reference if you really need that.
var file:File = File.applicationDirectory.resolvePath("includes/audio/bird.mp3");
var fileAccessible:File = File.applicationStorageDirectory.resolvePath("bird.mp3");
file.copyTo( fileAccessible );
trace( fileAccessible.nativePath );