---- written for Director 8 ---
---- Kumar.K ----
---- kumark@icode.com ----
------ Custom Properties ------
property WhichSprite,InkProp,WhereTo
-- Get Behavior Parameters --
on getPropertyDescriptionList
set description = [:]
set inklist =["Copy","Transparent","Reverse","Ghost", "Not copy","Not transparent","Not reverse","Not ghost",
"Matte","Mask","Blend","Add pin","Add","Subtract pin","Background transparent","Lightest","Subtract",
"Darkest","Lighten","Darken"]
addProp description, #WhichSprite, [#format:#Integer, #comment: "Which Sprite ?", #default:1,
#range:[#Min:1,#Max:the lastchannel]]
addProp description, #InkProp, [#format:#String, #comment: "Set the Ink of Sprite to :",
#range:inklist,#default:inklist[1]]
if the currentspritenum = 0 then
addProp description, #WhereTo, [#comment: "Where To Attach ?" ,#format:#String,
#range:["On EnterFrame","On ExitFrame"],#default:"On EnterFrame"]
else
addProp description, #WhereTo, [#comment: "Where To Attach ?" ,#format:#String,
#range:["On MouseUp","On MouseDown","On MouseEnter","On MouseLeave"],#default:"On MouseUp"]
end if
return description
end
-- Can be attached to both Sprite and Frame Scripts --
on isOKToAttach (me, aSpriteType, aSpriteNum)
case aSpriteType of
#graphic:
return True
#script:
return True
end case
end isOKToAttach
-- Get Behavior description --
on getBehaviorDescription
return "This Behavior Controls Ink Property of a Sprite." & RETURN & RETURN &
"Parameters" & RETURN &
"*Sprite Number." & RETURN &
"* Ink Type." & RETURN &
"* Where to attach this Script"
end
-- Events --
on EnterFrame me
if WhereTo = "On EnterFrame" then
controlInkProp
end if
end EnterFrame
on ExitFrame me
if WhereTo = "On EnterFrame" then
controlInkProp
end if
end ExitFrame
on MouseUp
if WhereTo = "On MouseUp" then
controlInkProp
end if
end MouseUp
on MouseDown
if WhereTo = "On MouseDown" then
controlInkProp
end if
end MouseDown
on MouseEnter
if WhereTo = "On MouseEnter" then
controlInkProp
end if
end MouseEnter
on MouseLeave
if WhereTo = "On MouseLeave" then
controlInkProp
end if
end MouseLeave
-- Custom Handler to Control Ink Type of a Sprite --
on controlInkProp
case InkProp of
"Copy":sprite(WhichSprite).ink=0
"Transparent":sprite(WhichSprite).ink=1
"Reverse":sprite(WhichSprite).ink=2
"Ghost":sprite(WhichSprite).ink=3
"Not copy":sprite(WhichSprite).ink=4
"Not transparent":sprite(WhichSprite).ink=5
"Not reverse":sprite(WhichSprite).ink=6
"Not ghost":sprite(WhichSprite).ink=7
"Matte":sprite(WhichSprite).ink=8
"Mask":sprite(WhichSprite).ink=9
"Blend":sprite(WhichSprite).ink=32
"Add pin":sprite(WhichSprite).ink=33
"Add":sprite(WhichSprite).ink=34
"Subtract pin":sprite(WhichSprite).ink=35
"Background transparent":sprite(WhichSprite).ink=36
"Lightest":sprite(WhichSprite).ink=37
"Subtract":sprite(WhichSprite).ink=38
"Darkest":sprite(WhichSprite).ink=39
"Lighten":sprite(WhichSprite).ink=40
"Darken":sprite(WhichSprite).ink=41
end case
updatestage
end
-- Custom Handler to Control Ink Type of a Sprite --
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA