dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Another Dynamic TB problem...

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Posts
    14
    I'm having a weird problem. I am using a dynamic text box to load in several text files at different stages in the movie. the TB has the instance name "myText" it all work fine when testing the movie in flash, but when I publish, the text is not loaded. Oh & yes, the *.txt files are in the smae directory as the .swf ??? Any ideas?

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    What are you using to load the text files? The new LoadVars() function?

    It might be better to post your .fla.

  3. #3
    Junior Member
    Join Date
    Jan 2002
    Posts
    14

    Lightbulb an easy mistake to make!

    I worked out the problem. I did not prefix a reference to a variable (framelabel) with _root. See line 6 in code below:

    thx 4 the help though!
    --------------------------------------------------
    1 function loadTextFiles(){
    2 //Create a new instance of the loadVars object and 3 assign it to a variable
    4 loadVarsText = new loadVars();
    5 //loads external text into the loadVars object
    6 loadVarsText.load(_root.frameLabel + ".txt");
    7 //Check for successful load of the data
    8 loadVarsText.onLoad = function (success){
    9 if (success){
    10 trace ("loaded frameLabel =");
    trace (frameLabel);
    myText.text=this.var1;
    _root.currentContent = myText.text;

    }
    else{
    trace("loading content...");
    }
    }
    }
    -------------------------------------------------------------

  4. #4
    Junior Member
    Join Date
    Jan 2002
    Posts
    14

    Lightbulb an easy mistake to make!

    I worked out the problem. I did not prefix a reference to a variable (framelabel) with _root. See line 6 in code below:

    I do have another question though. Do you know the constraints for instance names when publishing from MX to V5?

    --------------------------------------------------
    1 function loadTextFiles(){
    2 //Create a new instance of the loadVars object and 3 assign it to a variable
    4 loadVarsText = new loadVars();
    5 //loads external text into the loadVars object
    6 loadVarsText.load(_root.frameLabel + ".txt");
    7 //Check for successful load of the data
    8 loadVarsText.onLoad = function (success){
    9 if (success){
    10 trace ("loaded frameLabel =");
    trace (frameLabel);
    myText.text=this.var1;
    _root.currentContent = myText.text;

    }
    else{
    trace("loading content...");
    }
    }
    }
    -------------------------------------------------------------

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