1 Reply Latest reply on Sep 11, 2006 4:27 AM by Newsgroup_User

    Controll the Time

    Thepoor13
      hi all, i'm now to Director
      my Projector has 4 video with wmv format,
      i want to controll the time then when player play complete a film then it auto go to the first frame which is blank

      i use this Syntax
      on prepareFrame me
      global gStartTime
      gStartTime=_System.MilliSeconds
      end
      on EnterFrame me
      global gNowTime
      gNowTime=_System.MilliSeconds
      if gNowTime-gStartTime>=500000 then
      go 1
      end if
      end

      but they does not work?
      help me please!
        • 1. Re: Controll the Time
          Level 7
          Both the prepareFrame and the enterFrame functions are repeating at each
          frame loop, so your gStartTime is constantly being reset to a new value,
          so when you subtract gNowTime, the value will always be very small.

          If you want to do something like that, then you need to set the value
          for gStartTime only once, probably when you tell the .wmv to play.

          It's not a good idea to use an absolute value to test for the end of a
          digital video file. It may not be playing as fast as you want on all
          computers.

          Normally you would get the total length of the video and then test that
          value against the movie's current movietime. Something like this:

          ------------
          property thisSprite -- the dv sprite
          property totalLength

          on beginSprite me
          thisSprite = me.spriteNum
          totalLength = sprite(thisSprite).member.duration
          end

          on exitFrame me
          if sprite(thisSprite).movieTime >= totalLength then
          go 1
          end if
          end
          -------------

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/