9 Replies Latest reply on Oct 18, 2006 10:04 AM by Garek007

    How tro get variables from an external  Text File??

    AntiTRUST� Level 1
      Hi Everyone,
      I need to know one thing, how is it possible to get variables from a text file in Director ??

      Because in Flash, we can do it very easily to get variables from an external text file. But in director i am trying to find out a way to get information from a text file.


      Any help will be higly appreciated.



      Regards,
      Amir
        • 1. Re: How tro get variables from an external  Text File??
          Level 7
          You can read the text of a .txt file using the FILEIO xtra, GetNetText ()
          using the NetLingo Xtra or even by using GetProp (). I'm assuming that the
          variables are stored in a format you create and can be parsed.


          --
          Craig Wollman
          Word of Mouth Productions

          phone 212 928 9581
          fax 212 928 9582
          159-00 Riverside Drive West #5H-70
          NY, NY 10032
          www.wordofmouthpros.com


          "AntiTRUST?" <webforumsuser@macromedia.com> wrote in message
          news:eb6qn3$qu4$1@forums.macromedia.com...
          > Hi Everyone,
          > I need to know one thing, how is it possible to get variables from a text
          > file
          > in Director ??
          >
          > Because in Flash, we can do it very easily to get variables from an
          > external
          > text file. But in director i am trying to find out a way to get
          > information
          > from a text file.
          >
          >
          > Any help will be higly appreciated.
          >
          >
          >
          > Regards,
          > Amir
          >


          • 2. Re: How tro get variables from an external  Text File??
            wgb14 Level 1
            I am not sure what you mean, but if you want to set the contents of a text file = to a variable in director is easy. Just use BudAPI and the read funtions to read the contents to a text member in director and then set your variable = to the text of that member
            • 3. Re: How tro get variables from an external  Text File??
              Level 7
              > I am not sure what you mean, but if you want to set the contents of a text
              file
              > = to a variable in director is easy. Just use BudAPI and the read funtions
              to
              > read the contents to a text member in director and then set your variable
              = to
              > the text of that member

              While there are many things that BuddyAPI does that nothing else can, in
              this case, I don't think it's necessary. The FileIO xtra included with
              Director does this just fine. Or the free FileXtra. Or if it's a Shockwave
              thing, the ones that WoMP mentionned before will do.


              • 4. Re: How tro get variables from an external  Text File??
                Level 7
                actually, the netLingo xtra can be used without Shockwave. I've found it's
                a very reliable way to read a text file. (getNetText ())



                --
                Craig Wollman
                Word of Mouth Productions

                phone 212 928 9581
                fax 212 928 9582
                159-00 Riverside Drive West #5H-70
                NY, NY 10032
                www.wordofmouthpros.com


                "Darrel Hoffman" <no.address@all.com> wrote in message
                news:eb7pqt$6a9$1@forums.macromedia.com...
                >> I am not sure what you mean, but if you want to set the contents of a
                >> text
                > file
                >> = to a variable in director is easy. Just use BudAPI and the read
                >> funtions
                > to
                >> read the contents to a text member in director and then set your variable
                > = to
                >> the text of that member
                >
                > While there are many things that BuddyAPI does that nothing else can, in
                > this case, I don't think it's necessary. The FileIO xtra included with
                > Director does this just fine. Or the free FileXtra. Or if it's a
                > Shockwave
                > thing, the ones that WoMP mentionned before will do.
                >
                >


                • 5. Re: How tro get variables from an external  Text File??
                  Level 7
                  And of course, I'm talking about from a hard drive or other local media, not
                  an internet or other network connetion (which they were intended for)


                  --
                  Craig Wollman
                  Word of Mouth Productions

                  phone 212 928 9581
                  fax 212 928 9582
                  159-00 Riverside Drive West #5H-70
                  NY, NY 10032
                  www.wordofmouthpros.com


                  "Darrel Hoffman" <no.address@all.com> wrote in message
                  news:eb7pqt$6a9$1@forums.macromedia.com...
                  >> I am not sure what you mean, but if you want to set the contents of a
                  >> text
                  > file
                  >> = to a variable in director is easy. Just use BudAPI and the read
                  >> funtions
                  > to
                  >> read the contents to a text member in director and then set your variable
                  > = to
                  >> the text of that member
                  >
                  > While there are many things that BuddyAPI does that nothing else can, in
                  > this case, I don't think it's necessary. The FileIO xtra included with
                  > Director does this just fine. Or the free FileXtra. Or if it's a
                  > Shockwave
                  > thing, the ones that WoMP mentionned before will do.
                  >
                  >


                  • 6. Re: How tro get variables from an external  Text File??
                    Level 7
                    You can set the filename of an existing text member, or one you create
                    on the fly, to your text file and then use the text of the member:
                    --
                    tTextMember = _movie.newMember(#text)
                    tTextMember.filename = "path to your file"
                    tVariables = tTextMember.text
                    tTextMember.erase()
                    -- ... you now have the text from the external file
                    • 7. Re: How tro get variables from an external  Text File??
                      Level 7
                      Nice...in all the years, I didn't know you could set the fileName of a text
                      member to a .txt file.

                      Cool

                      --
                      Craig Wollman
                      Word of Mouth Productions

                      phone 212 928 9581
                      fax 212 928 9582
                      159-00 Riverside Drive West #5H-70
                      NY, NY 10032
                      www.wordofmouthpros.com


                      "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
                      news:eb82pq$grl$4@forums.macromedia.com...
                      > You can set the filename of an existing text member, or one you create on
                      > the fly, to your text file and then use the text of the member:
                      > --
                      > tTextMember = _movie.newMember(#text)
                      > tTextMember.filename = "path to your file"
                      > tVariables = tTextMember.text
                      > tTextMember.erase()
                      > -- ... you now have the text from the external file


                      • 8. Re: How tro get variables from an external  Text File??
                        AntiTRUST� Level 1
                        Hi everybody,
                        Thanks a lot you guys, I am still curious that how come i get soooo much responses. Anyways, thanks a lot.


                        Amir
                        • 9. Re: How tro get variables from an external  Text File??
                          Garek007 Level 1
                          Does this work in 8.5?
                          I'm pretty good with lingo but I can't seem to figure out where to place this script...