4 Replies Latest reply on Mar 9, 2007 7:49 AM by JF213

    loadText

    JF213
      I am trying to load an external text file into a window in flash and then link certain words to view information in another window inside of the same flash document. everything works fine except this line of code: video_container.loadMovie(loadText.arg);
      please see code below for details...

      here is code in notepad doc:
      &media=<a href="asfunction:_root.MyFunc,video1">Endless Moving</a><br><br><a href="asfunction:_root.MyFunc,loadText.video2">Anxious Resound</a>
      &video1=/video/Endless_Moving.swf&video2=/video/Anxious_Resound.swf

      AS code

        • 1. Re: loadText
          JF213 Level 1
          I did forget to mention that if I change this:

          function MyFunc(arg:String){
          trace("You clicked me!Argument was");
          video_container.loadMovie(loadText.arg);
          }

          to

          function MyFunc(arg:String){
          trace("You clicked me!Argument was");
          video_container.loadMovie(loadText.video2);
          }

          Then everything works great, but I want to keep all of the data external. Thank you!!
          • 2. Re: loadText
            ggshow Level 2
            you cannot run
            video_container.loadMovie(loadText.video1);
            until your text file
            text/news.txt
            fully loaded



            loadText.onLoad = function(correct) {
            if (correct) {
            trace("Loaded!!!!");
            fadeOn.top_left.infoText.html = true;
            video_container.loadMovie(loadText.video1); //try this
            } else {
            trace("file was not loaded!!!");
            }
            }
            • 3. Re: loadText
              JF213 Level 1
              the text file is first loaded, then the script was run so:
              video_container.loadMovie(loadText.video1);
              works fine...

              My issue is getting my function to work. It does not load the video.

              function MyFunc(arg:String){
              trace("You clicked me!Argument was");
              video_container.loadMovie(loadText.arg);
              }

              But if I set the variable directly in flash to this then everything works:

              function MyFunc(arg:String){
              trace("You clicked me!Argument was");
              video_container.loadMovie(loadText.video2);
              }

              I need to know how to do this the first way so that it stays dynamic. THANKS!
              • 4. Re: loadText
                JF213 Level 1
                Finally figured it out and I thought that I would share my answer.

                here is my txt file code:

                &media=<a href="asfunction:_root.MyFunc,/video/Endless_Moving.swf">Endless Moving</a><br><br><a href="asfunction:_root.MyFunc,/video/Anxious_Resound.swf">Anxious Resound</a><br><br>
                &video1=/video/Endless_Moving.swf

                here is AS code: