Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
XML Text Renderer v1.1
Director Publications
asPitchDetect Xtra
dmmMDB
DaoX
KeyPoll
123 Flash Menu
Data Linker Xtra
Video Mask
Josh Chunick's Personal Site
 

 

 

Behavior Toggle Pause / Play Audio

Added on 8/14/2003

 

Compatibilities:
D8 D8_5 D9 Mac PC Shockwave

This item has not yet been rated

Author: tcoursey

This script will pause the audio in channel 1 on the first click (by default) and then resume when clicked again. A nice toggle feature for pausing audio!

global tm
global paused
global soundfile

on beginsprite
  paused = 0
end

on togglesound
  soundfile = sound(1).member
  if paused = 0 then
    tm = sound(1).currenttime
    sound(1).pause()
    paused = not (paused)
  else if paused = 1 then
    sound(1).play([#member: member(soundfile), #startTime: tm])
    paused = not (paused)
  end if
end

on mouseup
  togglesound
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail