A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Loading Text files into a dynamic text field

  1. #1
    This way In
    Join Date
    Jan 2001
    Posts
    253
    How do you do it?

  2. #2
    ActionScript.org
    Join Date
    Aug 2000
    Posts
    1,030

    resolved

    Your dynamic text field will have a variable name. You simply create a file, call it something like file.txt, then enter this information:

    text=blah blah blah

    (this assumes your text field variable is called 'text'). Then you use this code in Flash:

    loadVariablesNum ("file.txt", 0);

    This will load your variable into Flash, and it should then show up in the text field.

    Cheers

    Jesse

  3. #3
    This way In
    Join Date
    Jan 2001
    Posts
    253
    See, thats what i thought, only at the bit which says "this will load your variable into flash", it didnt. any idea why? oh, if itll help, the text field is in an MC.

  4. #4
    This way In
    Join Date
    Jan 2001
    Posts
    253
    Ok, please help. i really need this to work... The text box is buried deep within an MC, which contains many MC's, etc etc, and eventually you get to the text box. The button is in as different MC. This idea works in theory, but something in the MC's is causing it not to load, so please - can anyone help!??

  5. #5
    This way In
    Join Date
    Jan 2001
    Posts
    253
    Help!

  6. #6
    ActionScript.org
    Join Date
    Aug 2000
    Posts
    1,030

    resolved

    If your text is within an MC then you will need to give the correct path. Say you have an MC on the main stage with the instance name of 'mc1' and then within that another with the instance name of 'mc2' then within that is your text field 'text', instead of doing:

    text=blah blah blah

    you must include the path:

    _root.mc1.mc2.text=blah blah blah

    Cheers

    Jesse

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