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
New Contributor
pahgawk
Posts: 4
Registered: ‎03-23-2011
My Device: None

Simulator's "Open File" browser only shows pictures

[ Edited ]

I've written an app that basically creates flowcharts, exports them as JPGs but also saves the project file as XML.

 

The XML does save, because when I make a new file and try to save a file of the same name the dialogue box says something along the lines of "Pressing save will overwrite the existing file [insert filename here.]" But when I use the browse() function (with no file filter), it says "Pictures" at the top and lists the exported JPGs, but doesn't show any of the XMLs. How do I change this so I can see the XML files, or am I even able to do so?

 

I was browsing File.documentsDirectory, but I had the same results with File.applicationStorageDirectory.

 

From the research I've done, it seems to just be a simulator bug of some sort. So, since the app works fine other than that (running the air app on my PC works fine with opening and loading files), should I submit it anyway? I'd greatly prefer to have it submitted by the March 31st deadline for the playbook offer, but I'd also prefer to test it first. But if it is a simulator issue, then I won't be able to test it until I actually get a playbook. Suggestions?

Please use plain text.
Regular Contributor
macwarrior
Posts: 75
Registered: ‎03-21-2011
My Device: None

Re: Simulator's "Open File" browser only shows pictures

I had this same problem -- no XML files show up in the browser, ever. I actually took out the functionality in my app because it was such a pain in the **bleep** -- decided it was better to have less features that all work than more features that are broken because the playbook simulator is old and broken too.

 

If it's a core part of your app I dunno what to tell you.

Please use plain text.
New Contributor
pahgawk
Posts: 4
Registered: ‎03-23-2011
My Device: None

Re: Simulator's "Open File" browser only shows pictures

 So do you think I'd just be better off making my own file browser to ensure it works? I've seen something of that sort here: http://www.adobe.com/devnet/air/flex/quickstart/articles/directory_search.html

Because this, like you said, an essential feature. :smileysad:

 

oh well. I think I can still finish it in time...

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Simulator's "Open File" browser only shows pictures

You may want to do your own simple "browser" since this will probably not get fixed and to us in the next week.  You could do an alert with the drop down as a basic "browser" to open a file.

Please use plain text.
Developer
billfoust
Posts: 382
Registered: ‎05-19-2008
My Device: BlackBerry Torch

Re: Simulator's "Open File" browser only shows pictures

Are you specifying a filter? Code from the adobe reference website

var fileToOpen:File = new File();
var txtFilter:FileFilter = new FileFilter("Text", "*.as;*.css;*.html;*.txt;*.xml");

try 
{
    fileToOpen.browseForOpen("Open", [txtFilter]);
    fileToOpen.addEventListener(Event.SELECT, fileSelected);
}
catch (error:Error)
{
    trace("Failed:", error.message);
}

 The SDK also says if no filter is specified, all files are shown. However, it might show different files if you specifically give a filter for XML.

Bill
-------------------------------------------
Check out my book on BlackBerry Development for Java.
And my other really really old book
My Apps: FlashKids
Please use plain text.
New Contributor
pahgawk
Posts: 4
Registered: ‎03-23-2011
My Device: None

Re: Simulator's "Open File" browser only shows pictures

Yeah, sadly, I tried that, once with a filter for just XML, another for anything (the * symbol, right?) with no avail.

 

Although, I made a workaround by building my own file browser using a dropdown combobox, and that seems to be working fine, so... I guess it's not quite as urgent an issue anymore :smileyvery-happy:

Please use plain text.