A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: ::: LINKING TO A TEXT FILE :::

  1. #1
    I'm having a hard time finding a tutorial or anything that shows me how to import text from a text file. PLEASE ANYBODY HAVE ANY HELP FOR ME?!?!?!?!

  2. #2
    Senior Member
    Join Date
    Jul 2000

    Text File.


    Here's a mini tutorial

    Firstly your textfile needs to be in the URL encoded format that flash understands, therefore to read 'NAME', 'AGE' and 'COUNTRY' from a text file it must look like this:


    Now to read this file into flash -

    Put three text fields on your main timeline.

    Right Click each text field in turn and name them NAME, AGE and COUNTRY.

    Now use the Load Variables into location action on the main time line and point this at your text file and specify LEVEL 0 or TARGET blank (not the word blank).

    when run - this should put the values into your text fields.

    In a movie its best to add a variable to the end of your file to tell flash all variables are loaded - eg:


    You could then add a loop after using load variables until the variable VARSLOADED=True.

    Hope this helps,


  3. #3
    Senior Member
    Join Date
    Aug 2000
    name a textarea input. in the first frame of ANY layer put Load variables("your_txt_file.txt","",vars=Post).

    in the text file you need to specify the string you are sending back to the flash movie.
    like &input=yourstringoftext. **important** "&" is the delimiter that carries the string back to the movie. you need to include it.

    thats it!
    good luck

  4. #4

    Smile :::THANKS:::

    Thanks guys! I was about to shoot myself. Edeveloper, I noticed the function will work with target set to the name of the text feild as well as with vars=post. Will this work both ways server-side?

  5. #5
    Senior Member
    Join Date
    Aug 2000
    it should be no problem and even better if you are going to have the txt area nested in a movieclip. actually i've never used a text file before. i just tried it real fast while i wrote you. mostly i return db recordsets to flash movies with asp.
    glad i could help.

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