Flash AS3 - Dialog Box (Returns Full File Path)

masterjake

New Member
Messages
73
Reaction score
0
Points
0
I'm assuming this thread goes here.

Anyway, I've been searching this for a while now. I need to create an Open Dialog Box in flash using Action Script 3 that when the user opens the file, it returns the full file path and name.

I tried FileReference but it can only return the name through FileReference.name (as far as I know).

I need the full path because I'm going to take the path returned and use it to load an external image onto the stage. Any help is appreciated, thanks. :)
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
According to kirupa, OpenFileDialog's FileName property contains the full path. If that doesn't work, you could always inspect the dialog in a debugger.

In Flash AS3, File's nativePath and browseForOpen() look promising.
 
Last edited:

masterjake

New Member
Messages
73
Reaction score
0
Points
0
According to kirupa, OpenFileDialog's FileName property contains the full path. If that doesn't work, you could always inspect the dialog in a debugger.

In Flash AS3, File's nativePath and browseForOpen() look promising.

Thanks, but the nativePath and browseForOpen() are for Adobe AIR only and not just regular Flash CS3 with AS3 (which is what I need).

The kirupa one doesn't even look like Flash at all :/
 

patmanbofh

New Member
Messages
2
Reaction score
0
Points
0
Hi there!

The following URL contains a sample AS3 script that allows the user to select a JPG file from their local filesystem and then loads it onto the stage using the loader and bitmap objects.

http://flexgraphix.com/blog/?p=51

At no point can you reference the file location explicitly (this is by design apparantly) but it would appear to meet your requirements:

I need the full path because I'm going to take the path returned and use it to load an external image onto the stage. Any help is appreciated, thanks. :)

The Zip file contains the FLA/SWF/AS/JPG files, although the FLA is a CS4 project!

Hope this helps!
 
Top