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

Posts: 327
Registered: ‎12-13-2010
My Device: Bold 9900/Z10 Special Edition
My Carrier: Rogers

2 questions related to file

Alright, so I'm like 50 lines of code away from finishin a NEW app, and I've either found a weird bug, or I'm just confused.


Take the following code snippet into consideration.

file = File.documentsDirectory;
var SaveString:String = new String("somefilename.png");
file.save(SavePNG, SaveString);


Now, don't get me wrong, this works beautifully, but when I use

file = file.fileReference();

 The save dialogue actually shows me the SaveString: somefilename.png, however with the first code snippet it does NOT show anything, just a blank text field.




Also Second thing. WHY ONT EARTH can I not save to the photos folder? I want people using my app to be able to see what they've saved without having to download a file browser.


Have I missed something? I have read the MSohms article on the various file.x usages, but I fail to see how I can actually save to anything other than documents/app local, etc?


Help would be appreciated. Thanks.

CEO/Lead Developer - Tensioncore™ Design Studios
http://tncr.ws/ - ShortenThis!™ for Blackberry Playbook | ShortenThis!™ for BlackBerry® 10
The Periodical Toe A highly informative Table of Elements
DrawThis! A fun drawing app for the BlackBerry® PlayBook™!
http://www.tensioncore.com/ - Tensioncore™ Web Hosting
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: 2 questions related to file

I have reproduced this issue with the default file name and logged it in our issue tracker: https://www.blackberry.com/jira/browse/TABLET-486


The file locations that are returned by the helper methods like File.documentsDirectory are cross platform AIR methods. Try using File.documentsDirectory.parent for the main shared directory, or File.documentsDirectory.resolvePath("../photos").

Tim Windsor
Open Source Technical Lead