+ Reply to Thread
Results 1 to 5 of 5

Thread: Flash AS3 - Dialog Box (Returns Full File Path)

  1. #1
    masterjake is offline x10Hosting Member masterjake is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    73

    Flash AS3 - Dialog Box (Returns Full File Path)

    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.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Flash AS3 - Dialog Box (Returns Full File Path)

    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 by misson; 07-27-2009 at 01:39 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    masterjake is offline x10Hosting Member masterjake is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    73

    Re: Flash AS3 - Dialog Box (Returns Full File Path)

    Quote Originally Posted by misson View Post
    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 :/

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Flash AS3 - Dialog Box (Returns Full File Path)

    Quote Originally Posted by masterjake View Post
    The kirupa one doesn't even look like Flash at all :/
    You're right. On closer examination, it looks like C#.

    Does debugging reveal anything of interest?
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  5. #5
    patmanbofh is offline x10Hosting Member patmanbofh is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    2

    Re: Flash AS3 - Dialog Box (Returns Full File Path)

    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:

    Quote Originally Posted by masterjake View Post
    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!

+ Reply to Thread

Similar Threads

  1. Replies: 0
    Last Post: 10-10-2007, 07:53 AM
  2. Open the EXE file in flash player.
    By satheesh in forum Tutorials
    Replies: 0
    Last Post: 10-04-2007, 09:55 AM
  3. [req] Urgent Flash File Needed!
    By Josh in forum The Marketplace
    Replies: 4
    Last Post: 03-24-2006, 09:20 PM
  4. Flash File Needed!
    By Josh in forum The Marketplace
    Replies: 5
    Last Post: 03-05-2006, 01:38 PM
  5. Banner Ads On Full Flash Site?
    By NK57thug in forum Free Hosting
    Replies: 2
    Last Post: 06-17-2005, 01:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers