Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Starfield Behavior
Pretty Script
Play/Pause/Stop SWA(Shockwave Audio)
Change ShapeType of a Shape Sprite
Key Code
PopUp Menu
HTML-ingo
markerXtra
XtraHelper
.HLP
MediaMacros Xtras Mall
 

 

 

Behavior Multiple-timer facility

Added on 7/2/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: Penworks (website)

Reproduced with permission from Penworks Lingo User"s Journal

-- Source Code from the Lingo User"s Journal
-- Copyright (c) 1995 by Penworks Corporation

on startMovie
  initTimer
  setTimer(#MusicTimer, seconds(15))
  SetTimer(#SoundTimer, seconds(30))
end startMovie

on stopMovie
  put "(stopped)"
  shutDownTimer
end stopMovie

on exitFrame
  if timerExpired(#MusicTimer) then
    put "Music timer expired"
    setTimer(#MusicTimer,seconds(20))
  end if
  if timerExpired(#SoundTimer) then
    put "Sound timer expired."
    killTimer(#SoundTimer)
  end if
  go to the frame
end exitFrame

-- Timer Services

global timerList

on seconds numSeconds
  -- Converts seconds to ticks, so you can refer to seconds(4) instead of 240 (4 * 60)
  return(numSeconds * 60)
end seconds

on timerExpired whichTimer
  -- Check to see if a given timer expired
  set expirationTime =getAProp(timerList, whichTimer)
  set expired =expirationTime and (getTimeCount() >= expirationTime)
  return(expired)
end timerExpired

on setTimer whichTimer, numTicks
  -- Set the expiration time of a timer
  set expirationTime =getTimeCount() + numTicks
  setAProp( timerList, whichTimer, expirationTime)
end setTimer

on killTimer whichTimer
  -- Force a timer to expire
  setAProp(timerList, whichTimer, 0)
end killTimer

on initTimer
  set timerList=[:]
end initTimer

on shutDownTimer
end shutDownTimer

on getTimeCount
  return the ticks
end getTimeCount

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail