2 Replies Latest reply on May 14, 2006 11:44 AM by monkeyboy1972

    loadvariables headache

    monkeyboy1972
      Hi could anyone help me I a little bit stuck - I need to pull in some text from and external file using loadvariables("xxxx", 0) - now I've acheived this - but when a button is pressed I need it to move onto the next keyframe, unfortunatley the text stays the same even though I've changed the code to pull from a different text file in the next keyframe - do I need to unload the loadvariables or am I barking up the wrong tree!!
      Any help would be appreciated
      cheers
        • 1. Re: loadvariables headache
          pwyon Level 1
          I'm not sure exactly what your asking, but I think you have two frames and you are trying to load data from two seperate files into different frames( but into the same TextField. Am I right? Kind of?
          If so, I think this code should do the job:

          //code on frame one//
          stop();

          var lv:LoadVars = new LoadVars();
          lv.onLoad = function( success:Boolean ){
          if(success){
          myTextField.text = this.myVar;
          }//end if
          }//end function
          lv.load( "text1.txt" ); //first load


          myButton.onPress = function(){
          lv.load( "text2.txt");//second load using same loadvars
          nextFrame();
          }//end button

          //end code//


          Frame 1 and 2 have a textfield named "myTextField".


          I hope that helps. It may be easier to help you if everone could see your code.
          • 2. Re: loadvariables headache
            monkeyboy1972 Level 1
            Hi cheers for the input i'll try the code you supplied - looks a bit more complicated than I expected!
            Your partialy right - Im trying to load data from separate files into separate text fields on separate keyframes but on the same layer.
            I'll get back to you soon with a result.
            cheers for the help!