A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: loadVars issue with textfile in a subfolder

  1. #1
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146

    loadVars issue with textfile in a subfolder

    I don't understand why my text isn't showing up in my dynamic text box.

    I have a movieclip with a txt1 text box on it that will include HTML.

    Here's the code I have to load the text file.

    Code:
    var R;
      //
      res=new LoadVars();
      res.load("textfiles/theband.txt");
    
      res.onData=function(info){
        if (info==undefined){
          R="Loading failed";
        }else{
           R=info;
        }
        txt1.htmlText=R;
      }
    this code works when the textfile is in the same folder as the movie but when its in a folder it doesnt show up. Is there something wrong with my syntax? Can someone explain this?

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    try:
    res.load("/textfiles/theband.txt");

    or
    res.load("../textfiles/theband.txt");

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