Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: View image from applicationStorageDirectory

@Tjitte: no problem at all! glad to help out :smileyhappy:

 

@kdittyr: thanks for pointing out my other thread. i updated the code to reflect the URL fix. sorry if the information mislead you!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: View image from applicationStorageDirectory

I still think this is a bug.  If you can read a file from the same directory, why can you read an image too.  Especially since it works fine in AIR.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: View image from applicationStorageDirectory

I'm new to ActionScript and to AIR, so please correct me if I'm wrong, but if JRab's recipe prefixing "file://" works, then I believe the following may be a "cleaner" approach:

 

imgLoad.setImage(File.applicationStorageDirectory.resolvePath("test.png").url);

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: View image from applicationStorageDirectory

hey,

 

@john: i dont think its a bug. its just their custom Image class and how it operates. May not be standard but doesnt mean its a bug. but i agree its a little weird.

 

@peter: yes you are correct in using that notation. it takes advantage of the File objects's property .url. using the resolvePath method returns a File object and allows you to treat it as such. more than one way to skin a cat i say! :smileyhappy:

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: View image from applicationStorageDirectory

Reason I think it is a bug, because the same class operates one way in AIR and another way on the PB.  Makes for diffilcult development if every little thing has to be tested on the PB.