A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: directory listing?

Hybrid View

  1. #1
    Senior Member fantasio's Avatar
    Join Date
    May 2000
    Location
    at the progress bar
    Posts
    409

    directory listing?

    hi there,

    i am creating a standalone application, which works well as a simple projector.
    however, it needs to load all files from an external folder, which is user updateable (user can put his / her own files there).

    how can i get the directory listing?

    i know that air delivers such functionality, but i try to avoid air for now.

    it has to work on mac and win of course.

    is this only possible with using swfstudio / zinc ?

    thanks!

  2. #2
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    The easiest way would be with a third party swf2exe tool but you can do this without them. What you need to do is call an external BAT file / AppleScript that creates an XML file that contains a list of files in the folder you're interested in, then you need to load that XML file into Flash. It won't be as pretty as a solution done with a third party swf2exe tool but it will work.
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  3. #3
    Senior Member fantasio's Avatar
    Join Date
    May 2000
    Location
    at the progress bar
    Posts
    409
    thanks northcode,
    do you have an example?
    my knowledge of applescript and BATs is a little rusty...

  4. #4
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    This BAT file will product an XML file that contains a list all files in the current directory (where the BAT file is started from). An example of the output is shown below. The ^ is the trick that allows the echo command to spit out < and > characters, which have special meaning in BAT files (they redirect input and output).

    Code:
    @echo off
    cls
    echo ^<files^> > files.xml
    for %%i in (*.*) do echo ^<file^>%%i^</file^> >> files.xml
    echo ^</files^> >> files.xml
    In this example, the BAT file itself (and the files.xml file) will show up in the output. The easiest fix for this is to use specific pattern masks in place of (*.*) in the BAT file so you exlude BAT and XML files.

    <files>
    <file>file1.pdf</file>
    <file>test.bat</file>
    <file>whatever.txt</file>
    </files>


    Sorry, I don't have an AppleScript solution handy but it should be just about as straightforward as the BAT file solution.
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center