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
import and play sound file (during runtime)
tea Xtra
cXtraCD
[S] mouse->sprite vector behaviour
Wait For Media Ready
Importing bitmaps without loosing white space
Viking board game
Impressario Thumbnail Slider
Complete Idiots Guide to Macromedia Flash 5
Sprite Recorder
 

 

 

Behavior Hold on a frame till sound finishes playing

Added on 6/12/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: KumarK

Holds for a sound to finish

---- written for Director 8 ---
---- Kumar.K kumark@icode.com ----

-- custom properties --
property soundchannel,whereto

------ Get Behavior Description List ------
on getPropertyDescriptionList me
  set description = [:]
  if the currentspritenum <> 0 then exit
  addProp description, #soundchannel, [#comment: "Wait for Which Channel ?", #format:#Integer, #range:[#min:1,#Max:8],#default:1]
  addProp description, #whereto, [#comment: "What to do after sound finishes Playing ?", #format:#String,
  #range:["Go Next Frame","Go Next Marker", "Go Previous marker", "Go Loop","Exit"],#default:"Go Next Frame"]  
  return description
end getPropertyDescriptionList
------ Get Behavior Description List ------

-- Get Behavior description --
on getBehaviorDescription
  return "This Behavior waits on a frame till the sound in the specified finishes Playing. " & RETURN & RETURN &
  "Parameters" & RETURN &
  "* Sound Channel" & RETURN &
  "* What to do after sound gets over"
end
-- Get Behavior description --

-- Events --
on prepareframe me
  sound(soundchannel).breakLoop()
end

on ExitFrame me
  if soundbusy(soundchannel) then
    go the frame
  else
    case whereto of:
      "Go Next Frame": go the frame + 1
      "Go Next Marker": go Next
      "Go Previous marker": go previous
      "Go Loop":
        go loop
      "Exit":quit
    end case
  end if
end ExitFrame
------ Events ------

------ Can be attached to only Script Channel ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
  case aSpriteType of
    #script:
      return true
  end case
end isOKToAttach
------ Can be attached to only Script Channel ------  

 


Contact

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

Send e-mail