A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Loading Text From External .txt file

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    28
    Can someone tell me how to load text from an external .txt file into Flash? I looked through the Flashkit tutorials and couldn't find anything that would help me. I want to load text from a file into a text field in my Flash movie, but have it change everytime the user pushes a button (ie I want it to be somewhat like a javascript array, but purely Flash driven). Any help is much appreciated.

    --Ashley

    -----------------
    "We don't know a millionth of one percent about anything."

  2. #2
    Junior Member
    Join Date
    Mar 2001
    Posts
    3
    Right..

    make a text box the size you want it, and in text properties for that box select dynamic text, multiline and word wrap (you can select the size and font and font color afterwards). If you want to read in a HTML format file then check the HTML box.

    You also have to give the text box a variable name, for now we will call it "textvariable".....

    and the file will be "myfile.txt"

    write whatever you need in the file... then go back to the start of the file and type "&textvariable=" (no inverted commas), you can combine as many variables in a text file as you wish....

    then, with the buttons that you wish to change the text, go into the actions window,under the basic actions choose "on mouse event" and check the "release" box, then under the actions heading, choose the load variable command...

    for the url type in the name of your text file (it must be in the same directory as the flash file), choose level 0, and dont send variables....

    done except for a small example
    ---------------
    *myfile.txt****
    ---------------
    &textvariable=I want this to be shown in flash!!


    ---------------
    actions in flash
    ---------------
    on (release) {
    loadVariablesNum ("myfile.txt", 0);
    }

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center