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 Linked Bitmaps
Blend Sprite
Multiple Monitors with Director
Dir Player
Draw a line with lingo
MD5 algorithm
cXtraRTFEditor
Refine a search - Valentina
Compound Interest
Bevel Follow Mouse or Sprite-Alphamania
 

 

 

Behavior Narration Tool

Added on 9/11/2004

 

Compatibilities:
D8

This item has not yet been rated

Author: dan_au

Attach this behaviour to any sprite on the stage. Choose your sound member, sound channel, intro time and outro time. The behaviour starts playing the member after the intro time is up, then goes to the next frame marker after the outr time has played. This works well for power point style presentations as the pages change automatically and on time.

property initTimer, theTimer, checkSound, initSound, leaveFrame, soundCh
property soundMember, introLength, outroLength
on beginSprite me
  initTimer = 0
  theTimer = the milliseconds
  checkSound = 0
  initSound= 1
  leaveFrame = 0
end

on exitFrame me
  if initSound then
    if (the milliseconds) - theTimer > (1000*introLength) then
      sound(soundCh).stop()
      sound(soundCh).setPLayList([])
      sound(soundCh).play(member (soundMember))
      initSound = 0
      checkSound = 1
    end if
  end if
  if checkSound then
    if  (the milliseconds) - theTimer > 2000 then
      initTimer = 1
      checkSound = 0
    end if
  end if
  if initTimer then
    if not  (sound(2).isBusy()) then
      leaveFrame = 1
      initTimer = 0
      theTimer = the milliseconds
    end if
  end if
  if leaveFrame then
    if  (the milliseconds) - theTimer > (1000*outroLength) then
      go #next
      leaveFrame = 0
    end if
  end if
end


on getPropertyDescriptionList (me)
  custProp = [:]
  custProp[#soundMember] = [
     #comment: "Play sound",
     #format: #sound,
     #default: ""]
  custProp[#soundCh] = [
     #comment: "in channel...",
     #format: #integer,
     #default: 1,
     #range: [1, 2, 3, 4, 5, 6, 7, 8]]
  custProp[#introLength] = [
     #comment: "start playing after __ seconds",
     #format: #integer,
     #default: 1]
  custProp[#outroLength] = [
     #comment: "go next __ seconds after sound finished",
     #format: #integer,
     #default: 1]
   return custProp
end getPropertyDescriptionList

 


Contact

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

Send e-mail