3 Replies Latest reply on Jul 7, 2008 4:09 AM by Newsgroup_User

    read file in a folder

      Can I read files in a folder with director? and use the name, the lenght and play them in a project?

        • 1. Re: read file in a folder
          Level 7
          There is a built in command called getNthFileNameInFolder() which you
          can use to get the names of all files in a given folder. I don't know
          what you mean about "length", but if those files are the sort that can
          be imported into Director, then you can bring them in at runtime. The
          method of doing so will depend upon what sort of files they are (images,
          sounds, etc)
          • 2. Re: read file in a folder
            annaelle19 Level 1
            Perfect, Thanks!
            The file in the folder are .mov or .mpg video.
            Now I can open the video without having to import them in the cast?
            with instruction like:
            but for the video?

            • 3. Re: read file in a folder
              Level 7
              For video, it will depend upon the video format you are using. If you
              have .mov files, then you would likely want to use the quicktime xtra.
              It comes with Director and is free to use. The down side is that you
              need to make sure that your client machines all have Quicktime
              installed. Quicktime should be able to also play your mpg files. You
              can put a #quicktime member on the stage and set it's .filename property

              member("QT").filename=the moviePath&"someMovie.mov"

              You would use the actual name of your QT member instead of member("QT")
              of course. And substitute the corret path/filename for your target
              movie file.

              If you do not want to worry about having QT installed, then you could
              use an xtra like MPEGAdvance which is not free, but it is super easy to
              use and does not require the QT runtime to be installed.