A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Beginner! Reading text files

  1. #1
    Junior Member
    Join Date
    Mar 2004
    Location
    uk
    Posts
    25

    Beginner! Reading text files

    Hi all,

    I am a novice at flash. I have just started to use flash mx 2004 in the last 2 weeks and have come across a problem.
    I have a VB script generating a text file containing over 100 lines of information. Can some one please help me to get Flash to read this text file on the press of a button, and display the contents in a new frame.
    Also is it possible to select only certain lines from this text file to display?

    Thanks

    Umar

  2. #2
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    There are two ways to load a text file into a flash movie:
    1. Plain text files using loadVariables, or the newer LoadVars. The text file must have the format:

    varName=bla bla bla&varName2=some more text&

    2. Load an xml file. This is a bit more complicated since you need to parse the document. You create an XML object in Flash using new XML(), then you load a file into the object, and last parse it.

    You can read more about LoadVars and XML in the Flash help. There are also lots of tutorials on the subject.

  3. #3
    Junior Member
    Join Date
    Mar 2004
    Location
    uk
    Posts
    25

    Text files

    Thanks for the reply,

    Is there any way to open the text file on the click of a button, or just read the whole text file without the need to modify it.
    The text file is generated by a VB script and i cannot modify it.

    thanks


    umarK
    Last edited by umark; 03-11-2004 at 02:33 PM.

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