0 Replies Latest reply on Jan 18, 2007 4:54 AM by flaskvacuum

    what's wrong with this myMedia.scrubbing code?

    flaskvacuum
      quote:


      myInvokeFirst();

      function myInvokeFirst(){
      displayListener.cuePoint = function(eventObj<img align="top" src="images/smilies/sa.gif" border="0" alt="">bject){
      var index:String = eventObj.cuePointName;
      var indexTime:Number = eventObj.cuePointTime;
      doThisTexts(indexTime);//texts only
      };
      };

      var myArrayText:Array = new Array(["my sentences here",1,21],["my 2nd sentences",21,40],["more texts", 40,60]);

      function doThisTexts(indexTime){
      for(var i:Number = 0; i<myArrayText.length; i++){
      if(indexTime>=myArrayText [1] && indexTime<myArrayText[2]){
      cue_txt.text = myArrayText [0];
      }
      }
      };

      displayListener.scrubbing = function(evtObj<img align="top" src="images/smilies/sa.gif" border="0" alt="">bject) {
      var scrubDrop:Number = Math.round(display.playheadTime);
      trace(scrubDrop);
      for(var i:Number = 0; i<myArrayText.length; i++){
      if(scrubDrop>=myArrayText
      [1] && scrubDrop<myArrayText [2]){
      cut_txt.text = myArrayText
      [0];
      }
      }
      }



      Problems encounter:
      1) i trace my scrubDrop and realise that the timing has shown the appropriate texts according to the array that i have set up. But when i view my actual application it didn't reflect the texts correctly . It seem that my cue_txt.text doesn't act fast enough to display the correct one. Do i need some text loader just like the movieClipLoader to achieve that?