2 Replies Latest reply on Jul 3, 2006 7:38 AM by NSurveyor

    Counting files in a Flder

      Hi all,

      I have to count the number of files in a folder and their respectives name in it using flash.Is it possible to do it by JSFL.

      can anyone give me samples regarding this.thanks in advance.

        • 1. Re: Counting files in a Flder
          injpix Level 3
          JSFL are used only during authoring time, so in other words only when you have Flash.exe open. It will assist you with the FLA you are viewing in Flash. To be able to read files and retrieve the names dynamically you would have to use PHP or Coldfusion to just name a few.
          • 2. Re: Counting files in a Flder
            NSurveyor Level 2
            If you are using JSFL (authoring environment),,,,

            var folder = fl.browseForFolderURL('SELECT FOLDER');
            if (folder!=null) {
            var list = FLfile.listFolder(folder, 'files');
            fl.outputPanel.trace("There are "+list.length+" files in the specified folder");
            fl.outputPanel.trace("The names of these files are: "+list);

            If you only wanted it to find .fla's for example, you would use:

            var list = FLfile.listFolder(folder+'/*.fla', 'files');

            I haven't tested this as I am not on a computer with Flash.