3 Replies Latest reply on Aug 7, 2007 9:04 PM by Newsgroup_User

    Search text + list folder content

    flashunter
      Hi, I'm new to Director and was wondering if anyone help me with guides/pointers for my personal project.

      I want to create a multimedia product/portfolio CD that has a search function (there's no database, I just need it to search based on keywords/ word occurrences in the pages within the presentation).
      I also want a page that list a certain folder content within the CD. The folder would contain PDF files that would be updated from time to time, and I want the listing be able to list new files as I add more PDFs into the folder. The item in the list would be clickable, and would automatically try to open user's PDF viewer to view the files.

      Can anyone help direct me on where to look?
      Any help would be much appreciated.
      Thank you in advance.
        • 1. Re: Search text + list folder content
          Level 7
          > I want to create a multimedia product/portfolio CD that has a search function
          > (there's no database, I just need it to search based on keywords/ word
          > occurrences in the pages within the presentation).

          If by "pages" you are referring to #text members, you can walk all the
          text members in your movie searching for a given character/word/phrase,
          something like:
          -- #movie handler
          on mGetMatchingTextMembers input
          lMembers = []
          if stringP(input) = 0 then return lMembers
          nLibs = _movie.castLib.count
          repeat with l = 1 to nLibs
          nMems = _movie.castLib[l].member.count
          repeat with m = 1 to nMems
          if member(m, l).type = #text then
          tText = member(m, l).text
          if offset(input, tText) then lMembers.append( member(m, l) )
          end if
          end repeat
          end repeat
          return lMembers
          end

          > I also want a page that list a certain folder content within the CD. The
          > folder would contain PDF files that would be updated from time to time, and I
          > want the listing be able to list new files as I add more PDFs into the folder.
          > The item in the list would be clickable, and would automatically try to open
          > user's PDF viewer to view the files.

          The simplest solution would perhaps be to use an xtra, like Buddy API,
          that will give you a list of file types in a given folder:
          tList = baFileList("@/PDFs/", "*.pdf")
          < http://www.mods.com.au>
          • 2. Re: Search text + list folder content
            flashunter Level 1
            Thank you, that really helped.

            I stumbled into another problem, however. I need to put scaled text inside the stage (100% width, 75% height). Is there a way to do this without converting it to bitmap? I need the text to still be treated as text so it can be searched.
            • 3. Re: Search text + list folder content
              Level 7
              > I need to put scaled text inside the
              > stage (100% width, 75% height). Is there a way to do this without converting it
              > to bitmap? I need the text to still be treated as text so it can be searched.

              Can you not set the text member to scroll?