Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

startTimer question...

Status
Not open for further replies.

raznov

Programmer
Apr 8, 2002
110
US
I have Director movie that is being driven by a large video and I am using the Tabuleiro extra to set cue points to show slides in time with the video, all of that works fine.

The video moves too quickly at one spot and we don't have time to reedit it. So, I set up a script that pauses the video at a specific cue. That part works fine.

The problem comes when I try to unpause the video. I want it to pause for 5 seconds, then start playing again. I added the following code starting from "startTimer", to the existing code with no luck in the restart. What am I doing wrong?

on cuePassed me, whichChannel, cuePointNumber, cuePointName
if sprite(11).member = member ("winn-35Qf2") then
Sprite(12).pause()
startTimer
if (the timer < 60 * 5) then
Sprite(12).play()
end if
else if cuePointName=&quot;gomenu&quot; then
go to &quot;presentationsmenu&quot;
else
sprite(11).member = member (cuePointName)
end if
end cuePassed
 
Try something like this:
Code:
--
property timerActivation

on beginSprite me
   timerActivation = VOID
   sprite(me.spriteNum).movieRate = 1
end beginSprite

on cuePassed me, whichChannel, cuePointNumber, cuePointName
   if sprite(11).member = member(&quot;winn-35Qf2&quot;) then
      timerActivation = 1
   else if cuePointName=&quot;gomenu&quot; then
      go to &quot;presentationsmenu&quot;
   else
      sprite(11).member = member (cuePointName)
   end if 
end cuePassed

on enterFrame me
   if timerActivation then
      sprite(me.spriteNum).pause()   
      startTimer
      timerActivation = VOID
   else if sprite(me.spriteNum).movieRate = 0 then
      if (the timer > 60 * 5) then 
         sprite(me.spriteNum).play()   
      end if
   end if
end enterFrame
--[code]
The problem of your code is that once you stop the video and start the timer, nothing is asked to check the timer therefore your video remains stopped forever.
(Also  &quot;[code]<
&quot; in &quot;
Code:
the timer > 60 * 5
&quot; was other way round.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top