A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: auto load data.txt

  1. #1
    Senior Member jordslaght's Avatar
    Join Date
    Jul 2001
    Posts
    399

    auto load data.txt

    right now I have a news section on my website that reads off of an external "data.txt" file

    but the way I have it set up now (the only way I could find to work) was to have a button with the actionscript:

    on (press) {
    loadVariables("data.txt", "_root.text_box");
    }

    is there a way for that to automatically be loaded? so i can just get rid of the button?
    thanks

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    21
    Just add the code to frame 1 of your animation.

    loadVariables("data.txt", "_root.text_box");

    Code doesn't have to be inserted into a button. The movie itself can run any script that you place in a frame.

  3. #3
    Senior Member
    Join Date
    May 2003
    Posts
    160
    here try this


    loadVariables("data.txt", _level0, "POST");

    and has long as the text box matchs the variable in the .txt file then it will auto load ... I'm adding the .fla and .txt file
    Attached Files Attached Files

  4. #4
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

  5. #5
    Senior Member jordslaght's Avatar
    Join Date
    Jul 2001
    Posts
    399
    thanks guys, I tried it all, and seeing the errors I was getting with what you gave me helped me do it right
    I ened up using this
    in the first frame of the MC in which the dynamic texy was located

    onClipEvent (load) {
    loadVariables("data.txt", "_root.text_box");
    }

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