read from a "text" file

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default read from a "text" file

    Dear Everyone

    I am a really beginner with Drirector. So I hope somewere can help me to have a better overwiew about start me projekt.

    short dicription:
    It should be like a "lexikon" you can choose in a list of words that you are searching or typ in a textfield and the list shows you "similar" Words and you can choose one. If you choosed you get more inforations to this word in different textfields and also you see a quicktime-movie to this word.

    what I wish to do:
    the nummer of the words, informations and the quicktime-movies can change: add, modify Informations, delete old ones (not in the Programm, but be the resarch-team) I want to read in the information, stored in text files (or database), from the file at runtime and link it (with a txtefile based list) to the video so that I can use one movie that change the quicktime and the text information if a user choose an other word in the list.

    my question:
    - I do not find any information how I can open and read from a textfile [or connect to a batabase] (and after that work with this data at "runtime")
    Where I must looking for this functionality for filehandling?
    Or is ther only the way of hardcoded links?
    - Is it possible to save perferences/settings from a user so that he can use it by the next time?
    where I can find this functions?

    Dear ueliisa


    Ueliisa Wenger webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. read XML file encoding="windows-1256"
      hi i made a simple project reads XML file and it works good when the file is encoded with UTF-8 (the file contains arabic text) but flash can't...
    2. Is there a module that can check if user "foo" may read a file?
      Hi i want to check a number of file against different user uid:s and see if they can read/write execute that file. I have searched on cpan but it...
    3. CS: "Could not read the file because there is not enough memory..." for placed PNG
      I was just up(?)graded to Illustrator CS from 10. I opened a map that was created in AI10, which links to a PNG image used as a tracing template....
    4. How can I "read" an .exe file in Linux?
      Hi all, we have made a cd with a Director projector. It was done using Director MX. We would like to know if it is possible to make it work in...
    5. How to make the "search text" feature work with non "txt" file
      On Fri, 27 Jun 2003 07:19:23 -0700, "Juergen" <anhorn@bktel.com> wrote: See MVP Doug Knox' comments and fix here:...
  3. #2

    Default Re:read from a "text" file

    Hi there you can use fileIO to import txt file

    My text file contains this text and is save in the same folder as your movie but you can save it anywhere as long as you specify a path:

    4-Orion,Enterprise,Titan,Harland Applicator

    on prepareMovie
    gFileObj = script("file handlers").new(the moviePath)
    gFileObj.mImportTxtFile("cdContent.txt")
    end

    this is "file handler" parent script:

    property pImportedTxt -- text imported from the txtfile
    property pFileObj -- fileIO object
    property pCDContentFilePath -- filepath to the cd content file

    -- create an instance of the fileIO object and store the relevent file paths
    on new me, txtFilePath
    pFileObj = new(xtra "FileIO")
    pTxtFilePath = txtFilePath
    return me
    end

    -- import the file passed and call the appropriate method
    on mImportTxtFile me, fileNamePassed
    pFileObj.openFile(pTxtFilePath & fileNamePassed, 1)
    pImportedTxt = pFileObj.readfile()
    pFileObj.closeFile()
    -- call the method to sort
    me.mSortContentFile()
    end

    on mSortContentFile me
    the itemDelimiter = "-"
    -- sort out number of products and save it in our variable store object
    numOfProducts = pImportedTxt.item[1]
    put numOfProducts -- i.e 4
    --
    namesOfProducts = pImportedTxt.item[2]
    the itemDelimiter = ","
    noOfItems = the number of items in namesOfProducts
    productList = []
    repeat with i = 1 to noOfItems
    productList.add(namesOfProducts.item)
    end repeat
    put productList -- ie ["Orion", "Enterprise", "Titan", "Harland Applicator"]
    end

    hope this helps some


    lefrog webforumsuser@macromedia.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139