Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-16-2012, 09:26 PM   #1
Registered User
Join Date: Nov 2009
Posts: 25
Default Help with file browsing

Hi all,

I am writing a little asset manager in Flash Builder 4.5, using the Flex4 SDK.

What I want to allow my users to do is be able to select a file from their hard drive. I have this very simply with:

ActionScript Code:
var file:File = new File(); file.addEventListener(Event.SELECT, fileSelected); file.browseForOpen("Select an image");

What is missing is:
#1 - I need to be able to open the dialog box on given folder. The system sets a default folder to look in in a previous step.

#2 - I want to pass a filter to the dialog box for both file type (PNG, JPG, GIF, etc.) and a prefix (MyAsset_* or something like that). A filename would conform to this type of filter - My_Asset_*.png or MyAsset_*.gif.

I know I can set a FileFilter, but that seems to only care about extensions.

Is there a way to do this with the SDK or will it require custom code? If so, can someone point me in the right direction on how to do that?


Raconteur is offline   Reply With Quote
Old 02-16-2012, 09:34 PM   #2
Registered User
Join Date: Nov 2009
Posts: 25

Ok... found how to set the folder to browse from:

ActionScript Code:
file.nativePath = "/Path/to/my/assets";

Easy enough...
Raconteur is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:26 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.