A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: I'm trying to display a complete txt file in a dynamic text field. (F8, AS2)

  1. #1
    Member
    Join Date
    Apr 2009
    Posts
    58

    I'm trying to display a complete txt file in a dynamic text field. (F8, AS2)

    So, there's only one frame. I tried putting this code on the frame without any objects on the stage:

    Code:
    this.createTextField("superduper", 10, 10, 10, 320, 100);
    superduper.autoSize = "left";
    superduper.border = true;
    superduper.multiline = true;
    superduper.wordWrap = true;
    
    var woot_lv:LoadVars = new LoadVars();
    woot_lv.onLoad = function (success:Boolean):Void {
        if (success) {
            superduper.text = woot_lv;
        } else {
            superduper.text = "Unable to load external file.";
        }
    }
    
    woot_lv.load("http://sites.google.com/site/televiv2/files/test.txt");
    It displays weird stuff in place of "-", space, tab, and going down a line.

    The text is supposed to look like this:

    Yo, this is a test.

    ------So I want to try this, see how
    well it works. Haha.

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    it looks like you want to send the innards of a loadvars object to a text field ...
    Have a look at XML onData() method instead

    Musicman

Tags for this Thread

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