dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Calling a .txt file in a flash movie

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    18

    resolved


    Hi,

    Can I call a .txt file clicking on a button in my movie.Please reply if anyone knows.

    Thank you
    Kamal

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hi,

    First you textfile needs to be formatted in a special way, lik this...

    myVar=the text I want to load into flash&moretext=some more text to load to flash&done=yes&

    save this as mytext.txt

    now in flash in one frame put a stop(); action and the button you want to use to load the text. Now give the button the actions

    on (release) {
    done = "";
    loadVariables("mytext.txt",this,"POST");
    gotoAndPlay(_currentframe + 1);
    }

    in the frame after that use

    if (done == "yes") {
    // the text is loaded
    gotoAndStop(_currentframe + 2);
    }

    in the frame after that use

    gotoAndPlay(_currentframe - 1);

    then finally in the next frame you can put dynamic textfields with variable names myVar and moretext (or whatever you called the variables in the text file) to display the contents of the file.

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