0 Replies Latest reply on Jan 7, 2011 5:48 AM by donjose83

    Sending dynamic text to an external SWF

    donjose83

      Sending dynamic text to an external SWF

      Ok, I'm trying to figure this out but I'm not sure I'm doing it right.

       

      I have a Flash file with an FLVPlayback component that loads a video.  I have an actions frame that sets listeners and then sends the current running time of the FLV video to dynamic text boxes in my "timecode" movie clip.  That all works fine as long as I have the "timecode" mc and the actions in the same timeline.

       

      BUT, I'm trying to put the "timecode" mc in the FLV player skin swf so that I can use the auto hide feature for the skin etc.

      I think my pathing etc is all screwed up because I can't get this to work.  My skin swf is called "skin.swf"

       

      Here' the time code code that works when the "timecode" mc is in the same timeline:

       

      "timecode.txTime1" and "timecode.txTime2" are the two different text boxes in the "timecode" mc.

       

      ---------------------------------------------------------------------- --------

      import fl.video.*;

      var listenerObjectBuff:Object = new Object();
      var listenerObjectPlay:Object = new Object();
      listenerObjectPlay.playheadUpdate = function(eventObjectPlay:Object):Void  {
              var elapsedTime = eventObjectPlay.playheadTime;
              var minutes:Number = Math.floor(elapsedTime / 60);
              var seconds:Number = Math.floor(elapsedTime % 60);
              var elapsedTime_str:String = ((minutes >= 10) ? minutes : "0" + minutes) + ":" +
      ((seconds >= 10) ? seconds : "0" + seconds);
             
       
        timecode.txTime2.text = elapsedTime_str;
          
              var minutes2:Number = Math.floor((video.totalTime) / 60);
              var seconds2:Number = Math.floor((video.totalTime) % 60);
              if (minutes2 < 0) {
                      minutes2 = 0;
              }
              if (seconds2 < 0) {
                      seconds2 = 0;
              }
              var remainingTime_str:String = ((minutes2 >= 10) ? minutes2 : "0" + minutes2) + ":" +
      ((seconds2 >= 10) ? seconds2 : "0" + seconds2);
              timecode.txTime1.text = remainingTime_str;
      };
      listenerObjectBuff.stateChange = function(eventObjectBuff:Object):Void  {
              if (video.buffering) {
                      timecode.txTime1.text = "Buffering";
              } else if (video.paused) {
                      timecode.txTime1.text = "Paused";
              }
      };
      video.addEventListener("stateChange", listenerObjectBuff);
      video.addEventListener("playheadUpdate", listenerObjectPlay);
      video.volume = 100;
      video.bufferTime = 10;

      ---------------------------------------------------------------------- --------

       

      So basically, how do I tweak this code so that I can send the time code information from my flash file to the "timecode.txTime1" dynamic text box in "skin.swf" which is then pulled back into my main Flash file ?

       

      Thanks, I appreciate any info you can give me!

       

      Regards,

      Don Jose