5 Replies Latest reply on Jul 10, 2006 7:11 AM by kglad

    finding text file

    finder_
      I put together a small news scroller and use Action Script to scroll the Dynamic text file. Everything seems to work find but the text does not show up. The lay out I have is this.
      I am a noobie
      Flash MX 7.2 pro

      Timeline 3 layers
      layer 1
      Action Script scene1
      script: frame 1
      loadVariablesNum("welcome.txt", 0);
      welcome.autosize = "left";
      var maxheight = welcome._height;
      var maxpos = 365-maxheight;
      gotoAndStop(2);
      .......................................................................................... .............................
      script: frame 2
      if (welcome._y<maxpos) {
      welcome._y = 370;
      }
      welcome._y -= 1;
      gotoAndPlay(2);
      .......................................................................................... .....................................
      layer2
      Text
      The text I use is in the same folder as the rest and is 1k file and has the name welcome

      Layer3
      background A jpa pic







        • 1. Re: finding text file
          kglad Adobe Community Professional & MVP
          you have a textfield with no instance name and with associated variable = welcome and that textfield exists on frame 1 of your swf. both true or no?

          and your code in frame 2 is supposed to do what?
          • 2. Re: finding text file
            finder_ Level 1
            Thanks for the tip kglad. I can see now why it could not see the text. You got to let it know what to use. Forgot all about the associated variable fpr the text.

            What I am trying is a non stop scroller and in 2 It is to keep the message scrolling. I may have to work with the number to get it to work with in the the background frame. I have tryed it and now the scrolling stop but can see the text.
            • 3. Re: finding text file
              kglad Adobe Community Professional & MVP
              oh, you are trying to use a frame loop. you don't want to use gotoAndPlay(2) on frame 2. put that on frame 4.
              • 4. Re: finding text file
                finder_ Level 1
                OK why on 4 and not on 2. The text and the loop should work on 2 as that the only thing that it has to do. Or am I missing something .
                • 5. Re: finding text file
                  kglad Adobe Community Professional & MVP
                  as soon as the playhead enters frame2 the code executes which directs the playhead to frame 2 (it's already there so that causes no change), stuff is revealed on stage in frame 2 and then the playhead continues to frame3.

                  the result of your gotoAndPlay(2) on frame 2 is the same as not having that code. ie, it does nothing.

                  if you want a frame loop so frame 2 plays repeatedly, place that gotoAndPlay(2) in a frame after frame 2. but if you place it in frame 3 then nothing on-stage in frame 3 will be displayed because the code executes first and then the stage is updated.