This allows any sprite to fade in and out in at a set rate, trigger the fade in /out of aother sprites and call other lingo commands
-- Fade In and Out --
-- This causes any given sprite onScreen to fadeIn or fadeOut --
-- By Neil Madsen...nmadsen@tri-mediapro.com -- April 21, 1999 -- updated August 27, 1999 --
-- BrouHaHa Productions copyright 1999 --
-- This behavior is freely distributable as long as these ABOUT lines are kept in tact --
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
property pFadeInOut -- values are #fadeIn or #fadeOut or #stopFade
property pMySprite -- sprite that the script is attached to
property pBlendIncrement -- the amount that the sprite fades in and out by...(1 - 10)
property pCycle -- cycles blending in and out values are #yes or #no
property pInitBlendAmount -- sets the initial opaqueness of the sprite...(0 - 100)
property pMaxBlendAmount -- sets the maximum blend amount for the sprite...How opaque?...(0 - 100)
property pMinBlendAmount -- sets the minimum blend amount for the sprite...How transparent?...(0 - 100)
-- added on Aug.27 1999
property pNextSprite -- the sprite that is supposed to fade in or out next
property pNextSpriteInOrOut -- values are "in" or "out"
property pCallOtherLingo -- allows you to call to other lingo scripts in your movie scripts
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
on beginSprite me
pMySprite = me.spriteNum
initFading
end beginSprite
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
on initFading me
-- sets the ink of the sprite to blend
-- sets the initial opaqueness value of the sprite
sprite(pMySprite).ink = 32 -- blend
sprite(pMySprite).blend = pInitBlendAmount
end initFading
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-- if the property pCycle is TRUE (1) or FALSE(0) then it performs the
-- proper function to either cycle back and forth or do a one time fade
-- in or out.
on exitFrame me
if pCycle = 1 then
cycleFade
else
case pFadeInOut of
#fadeIn:
sprite(pMySprite).blend = sprite(pMySprite).blend + pBlendIncrement
if sprite(pMySprite).blend >= pMaxBlendAmount then
pFadeInOut = #stopFade
-- added Aug.29/99
if pNextSprite <> 0 then
sendSprite(pNextSprite, #setFadeInOutValue, pNextSpriteInOrOut)
end if
if pCallOtherLingo <> "" then
do pCallOtherLingo
end if
-- end added Aug.29/99
end if
#fadeOut:
sprite(pMySprite).blend = sprite(pMySprite).blend - pBlendIncrement
if sprite(pMySprite).blend <= pMinBlendAmount then
pFadeInOut = #stopFade
-- added Aug.29/99
if pNextSprite <> 0 then
sendSprite(pNextSprite, #setFadeInOutValue, pNextSpriteInOrOut)
end if
if pCallOtherLingo <> "" then
do pCallOtherLingo
end if
-- end added Aug.29/99
end if
end case
end if
end exitFrame
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-- this handler is used to capture a
-- sendSprite(x, #setFadeInOutValue, "in or out") call
-- sent from a button click to begin a fade in or out
on setFadeInOutValue me, inOrOut
case inOrOut of
"in": pFadeInout = #fadeIn
"out": pFadeInOut = #fadeOut
end case
end setFadeInOutValue
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-- cycles from the min to max (and back again) blend amounts by the amount
-- specified in pBlendIncrement
on cycleFade me
case pFadeInOut of
#fadeIn:
sprite(pMySprite).blend = sprite(pMySprite).blend + pBlendIncrement
if sprite(pMySprite).blend >= pMaxBlendAmount then --100 then
pFadeInOut = #fadeOut
-- added Aug.29/99
if pNextSprite <> 0 then
sendSprite(pNextSprite, #setFadeInOutValue, pNextSpriteInOrOut)
end if
if pCallOtherLingo <> "" then
do pCallOtherLingo
end if
-- end added Aug.29/99
end if
#fadeOut:
sprite(pMySprite).blend = sprite(pMySprite).blend - pBlendIncrement
if sprite(pMySprite).blend <= pMinBlendAmount then --0 then
pFadeInOut = #fadeIn
-- added Aug.29/99
if pNextSprite <> 0 then
sendSprite(pNextSprite, #setFadeInOutValue, pNextSpriteInOrOut)
end if
if pCallOtherLingo <> "" then
do pCallOtherLingo
end if
-- end added Aug.29/99
end if
end case
end cycleFade
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
on getPropertyDescriptionList me
pdList = [:]
setaProp pdList,#pFadeInOut,[#default:#fadeIn, #format:#symbol, #comment:"Fade In or Out?", ¬
#range:[#fadeIn, #fadeOut, #stopFade]]
-- Next sprite to fade in or out property's
setaProp pdList, #pNextSprite, [#comment: "Fade which sprite next", ¬
#format: #integer, #default: 0, #range: [#min: 0, #max: 500]]
setaProp pdList,#pNextSpriteInOrOut,[#default:"in", #format:#string, #comment:"Next sprite is to Fade In or Out?", ¬
#range:["in", "out"]]
setaProp pdList,#pCallOtherLingo,[#default:"", #format:#string, #comment:"Any other calls you want to make?"]
return pdList
end getPropertyDescriptionList
on getBehaviorDescription me
gbDesc = "This allows any sprite to fade in and out in at a set rate, trigger the fade in /out of aother sprites and call other lingo commands."
return gbDesc
end getBehaviorDescription
on getBehaviorTooltip me
gbToolTip = "This allows any sprite to fade in and out in at a set rate, trigger the fade in /out of aother sprites and call other lingo commands."
return gbToolTip
end getBehaviorTooltip
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA