07-20-2011 09:07 AM
07-20-2011 09:12 AM
Please note that using nativePath also loaded the images in desktop air version, it only had problems on playbook. I don't understand what do you mean by using File object and accessing the user selected images with nativePath.
But using .url property, I was able to load the images on playbook.
07-20-2011 09:23 AM
Can you post the code that was working on the desktop and not on the PlayBook. Would like to see if there is a bug somewhere.
There are 2 ways to load files.
With the Loader class.
var file:File = File.applicationDirectory.resolvePath( "image.png" ); var loader:Loader = new Loader(); loader.load( new URLRequest( file.url ) );
Or with FileStream
var file:File = File.applicationDirectory.resolvePath( "image.png" ); var stream:FileStream = new FileStream(); stream.open( file, FileMode.READ ); var bytes:ByteArray = new ByteArray(); stream.readBytes( bytes ); var loader:Loader = new Loader(); loader.loadBytes( bytes );
I have found that loading with FileStream can be faster then Loader.load(). It also gives you the option for your loading to be synchronous if you need.