A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Load a text file

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    1

    Question Load a text file

    Hello all together my name is chris, i am very new to flash worked before in VB.net so this question might be a little DUMB.

    i have a flash file where i have created a text it is dynamic

    i would need to get evry 10 seconds an update on this text from a file called

    update.txt

    I AM REALLY LOST since this is the 3 day i am using flash normaly i find evrything i need on the web with help of mr. google but this time i failed!

    i am not a "script kiddy" but this time i really could use some help or code THX 1000 times in advance ps.: i am using the old macromedia flash thing 8

  2. #2
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    Can you upload your FLA - whatever you have tried ? OR should I create a new one for you ?
    As ever,
    Vinayak Kadam

  3. #3
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Say your dynamic textfield's Instance Name (select it, open Properties Panel [CTRL+F3], type something in the textfield labeled, Instance Name) is for instance, my_txt, and your .txt file is on the same folder as the Flash file, use this code on your Frame (select Frame, open Actions Panel [F9]):

    Actionscript Code:
    function updateText(){
        loadText = new LoadVars();
        loadText.onData = function(data){
            my_txt.text = data;
            // change my_txt to your dynamic textfield's Instance Name
        }
        loadText.load("update.txt");
    }

    updateText();

    setInterval(updateText, 10000);

    Hope this helps

    POST #1234 - hahahaha xD
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

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