---- written for Director 8 ---
---- Kumar.K ----
---- kumark@icode.com ----
------ Custom Properties ------
Property whereTo,spriteToBlend, Endblend
------ Get Behavior Description List ------
on getPropertyDescriptionList me
set description = [:]
if the currentspritenum = 0 then exit
addProp description, #spriteToBlend, [#comment: "Choose the Sprite to Blend:",#format:#Integer,#range:[#min:1,#max:the lastchannel],#default:the currentspritenum]
addProp description, #Endblend, [#comment: "Choose the BlendLevel :",#format:#Integer,#range:[#min:1,#max:100],#default:100]
addProp description, #WhereTo, [#comment: "Where To Attach ?" ,#format:#String,
#range:["On MouseUp","On MouseDown","On MouseEnter","On MouseLeave"],#default:"On MouseUp"]
return description
end getPropertyDescriptionList
------ Get Behavior Description List ------
-- Get Behavior description --
on getBehaviorDescription me
return
"Blend given sprite from 0 to given value" & RETURN & RETURN &
"This Behavior Blends the given sprite from 0 to the given value" & RETURN & RETURN &
"PARAMETERS:" & RETURN &
"* Sprite Number" & RETURN &
"* Blend Level."
end getBehaviorDescription
-- Get Behavior description --
------ Availbale for only Sprite Script ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
case aSpriteType of
#graphic:
return true
#script:
return false
end case
end isOKToAttach
------ Availbale for only Sprite Script ------
-- Events --
on MouseUp
if WhereTo = "On MouseUp" then
blendsprite
end if
end MouseUp
on MouseDown
if WhereTo = "On MouseDown" then
blendsprite
end if
end MouseDown
on MouseEnter
if WhereTo = "On MouseEnter" then
blendsprite
end if
end MouseEnter
on MouseLeave
if WhereTo = "On MouseLeave" then
blendsprite
end if
end MouseLeave
------ Events ------
--- Custom Handler to Blend the spriite
on blendsprite
set the ink of sprite spriteToBlend = 32
repeat with i = 0 to endblend
set the blend of sprite spriteToBlend = i
updatestage
end repeat
end if
end
--- Custom Handler to Blend the spriite
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA