4 Replies Latest reply on Jul 29, 2007 2:36 AM by shahgillani

    External Text Marquee

    shahgillani
      Hi,
      This is the simplest way of loading external text into a Dynamic Text Field: loadVariablesNum("YourFile.txt", 0);
      Right ...

      Could anyone please tell me what is the simplest way of animating it ?
      I need a marquee effect for external text loaded into a dynamic text field ...

      Thanks in advance
      Hassan
        • 1. Re: External Text Marquee
          Greg Dove Level 4
          Its one way of doing it. It could be considered simple I guess if YourFile.txt contains urlencoded text, e.g. something like

          mytext=hello this is my text and thats all

          then if your textfield has a variable association (e.g. flash 8 or less, as2) and its associated with the variable mytext

          You could use an approach like the following for character level horizontal scrolling (the simplest approach) within a fixed size, single line ,non selectable textfield (here the scrolling speed depends on frame rate - use setInterval if you don't want frame-rate based approach);
          • 2. Re: External Text Marquee
            shahgillani Level 1
            Thnx GWD,
            But I guess I need a little more help ...
            It's not working yet ...
            • 3. External Text Marquee
              Greg Dove Level 4
              OK. I don't think you need to use LoadVariablesNum - although I guess that should work (I don't use these anymore I always use LoadVars)

              If you see the trace working but nothing displaying then you just need to associate you variable with a dynamic text field on stage

              Give this a try:

              //testing only... this would normally be set up in the external YourFile.txt text file without the quotes (actually I just looked at some of the livedocs examples and they used quotes... but I don't usually.
              mytext="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

              //code on main timeline
              loadVariables("YourFile.txt", this);
              this.onEnterFrame = function() {
              if (mytext=="" || mytext==undefined) return;
              var tmpArr = mytext.split("");
              tmpArr.push(tmpArr.shift());
              mytext= tmpArr.join("")
              trace(mytext);
              }
              • 4. Re: External Text Marquee
                shahgillani Level 1
                Many thnx Dude ...
                Its working now ...