A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: GRRRRR ARGH(import .txt)

  1. #1
    Member
    Join Date
    May 2004
    Location
    blah
    Posts
    81

    GRRRRR ARGH(import .txt)

    My Dynamic Text field does not load .txt files.

    My code, as far as I can tell, looks exactly as it should. I've spent the last two hours looking through forums checking and double-checking stuff that people supposedly easily overlook(like the text color, or resizing the textbox with the deform tool). Nope, not even the slightest hint as to what may be going on.

    Also, why can't I find the Scrollbar component?

    Code:
    Frame 1:
    
    newsData = new LoadVars();
    newsData.onLoad = function(){
         newsbox.text = newsData.news;
    }
    newsData.load("news.txt");
    stop();
    blah.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    newsData = new LoadVars();
    newsData.load("news.txt");
    newsData.onLoad = function(success) {
    if (success) {
    trace ("done loading");
    newsbox.text = this.news;
    } else {
    trace ("not loaded");
    }
    };

    As for the AS1.0 MX only components, you'll find them here...

    http://www.macromedia.com/cfusion/ex...&extID=1009423

  3. #3
    Member
    Join Date
    May 2004
    Location
    blah
    Posts
    81
    Thanks a lot! I guess I forgot to take into account the fact that importing is asynchronous. One more question:

    What kind of changes would I have to make to the .txt file in order to support HTML? Does it look for "&"-tagged variables just like loadVars? Or will I have to split up my .txt's?
    Last edited by Numbermind; 09-03-2004 at 10:28 PM.
    blah.

  4. #4
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    &var1=hello&var2=goodbye
    that will create 2 variables
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    newsData = new LoadVars();
    newsData.load("news.txt");
    newsData.onLoad = function(success) {
    if (success) {
    trace ("done loading");
    newsbox.html = true;
    newsbox.htmlText = this.news;

    } else {
    trace ("not loaded");
    }
    };

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