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
Installed Fonts
Gravitational Force
GetPixelColour
Drop Shaddow Button-Alphamania
Irregular Slider
Multiple Monitors with Director
Sarah"s Multiuser Pages
Get Member Modified Time and Date
Export JPEG
ZGTSB-ButtonUp
 

 

 

Behavior Increase/ Decrease Digital Video Volume

Added on 6/15/2000

 

Compatibilities:
behavior D7 D8 PC

This item has not yet been rated

Author: KumarK

Increase/Decrease Digital Video Volume

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

--- Custom Properties ---
property TheSprite,WhereTo,Up_down,Up_downlevels
--- Get Behavior Description List ---
on getPropertyDescriptionList me
  DigitalvideoSpriteList=searchDigitalVideo (me)
  descriptionlist = [:]
  spriteassignlist=["Mouse Up","Mouse Down", "Mouse Enter","Mouse Leave"]
  frameassignlist=["Exit Frame","Enter Frame"]
  if DigitalvideoSpriteList.count > 0 then
    addprop descriptionlist,#TheSprite,[#comment:"Digital Video Sprite Number :",  
    #format:#String,#range:DigitalvideoSpriteList,#default:DigitalvideoSpriteList[1]]
  else
    addprop descriptionlist,#TheSprite,[#comment:"Digital Video Sprite Number :",#format:#Integer,#range:[#min:1,max:the lastchannel],#default:1]
  end if
  addprop descriptionlist,#Up_down,[#comment:"Choose The volume :",#format:#String,#range:[">>","<<"],#default:">>"]
  addprop descriptionlist,#Up_downlevels,[#comment:"Choose The steps to >>/<< the Volume :",#format:#integer,#range:[#min:1,#max:30],#default:1]
  if the currentspritenum <> 0 then
    addprop descriptionlist, #WhereTo, [#comment:"Where To Assign this Script ?", #format:#String,#range:spriteassignlist,#default:spriteassignlist[1]]
  else
    addprop descriptionlist, #WhereTo, [#comment:"Where To Assign this Script ?", #format:#String,#range:frameassignlist,#default:frameassignlist[2]]
  end if  
  return descriptionlist
end getPropertyDescriptionList
--- Get Behavior Description List ---

-- Get Behavior description --
on getBehaviorDescription
  return "This Behavior controls Volume Digital Video Sprite " & RETURN & RETURN &
  "Parameters" & RETURN &
  "* Digital Video Sprite." & RETURN &
  "* Increase/decrease" & RETURN &
  "* Where to attach this Script"
end
-- Get Behavior description --

-- events --
on mouseUp me
  if WhereTo="Mouse Up" then
    ControlVideoSprite
  end if
end

on mouseDown me
  if WhereTo="Mouse Down" then
    ControlVideoSprite
  end if
end

on mouseEnter me
  if WhereTo="Mouse Enter" then
    ControlVideoSprite
  end if
end

on mouseLeave me
  if WhereTo="Mouse Leave" then
    ControlVideoSprite
  end if
end

on enterframe
  if WhereTo="Enter Frame" then
    ControlVideoSprite
  end if
end

on ExitFrame
  if WhereTo="Exit Frame" then
    ControlVideoSprite
  end if
end
-- events --

-- custom handlers --
on ControlVideoSprite
  if member(sprite(TheSprite).member).type=#digitalvideo or member(sprite(TheSprite).member).type=#QuickTimeMedia then
    case Up_down of
      ">>":        
        if the volume of sprite TheSprite < 256 then
          the volume of sprite TheSprite=the volume of sprite TheSprite + Up_downlevels
        end if
      "<<":
        if the volume of sprite TheSprite > 1 then
          the volume of sprite TheSprite=the volume of sprite TheSprite - Up_downlevels
        end if        
    end case
  end if
end
-- custom handlers --

------ Availbale for both Frame & Sprite Script ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
  case aSpriteType of
    #graphic:
      return true
    #script:
      return True
  end case
end isOKToAttach
------ Availbale for both Frame & Sprite Script ------


------ Search for QT/AVI Sprite ------
on searchDigitalVideo me
  DigitalvideoSpriteList = []
  repeat with i = 1 to the lastchannel
    if member(sprite(i).member).type=#digitalvideo or member(sprite(i).member).type=#QuickTimeMedia then
      DigitalvideoSpriteList.append(i)
    end if
  end repeat
  return DigitalvideoSpriteList
end
------ Search for QT/AVI Sprite ------  

 


Contact

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

Send e-mail