This will fade a sprite in and out. You don"t really need it I guess because there is one kind of like this in the behavior library in the internal director behavior toolbar. Oh well here it is anyway.
-- Written by Mark Daggett 1999 (mark@flavoredthunder.com)
-- Copyright 1999 Flavored Thunder Media. All rights reserved.
-- For more free code go to: Http://www.flavoredthunder.com
-- Use it till it is obsolete :)
property pTheSprite
property pStartVal
property pOffstage
property pSpeed
property pSwitch
on beginSprite me
set pSwitch = FALSE
set pSpeed=6
set pOffStage = -999
set pTheSprite = the currentSpriteNum
set the ink of sprite the currentSpriteNum to 32
set pStartVal = 100
end
on exitFrame me
if pSwitch = TRUE then
if pStartVal <1 then
set the locH of sprite pTheSprite = pOffstage
set the blend of sprite pTheSprite = 100
set the ink of sprite the currentSpriteNum to 37
set pSwitch = FALSE
reset
--fade is done
return
else
sendAllSprites(#updateFade)
set the blend of sprite pTheSprite = pStartVal
set pStartVal = pStartVal-pSpeed*3
updateStage
end if
else
end if
end
on reset me
set pSwitch = FALSE
set pSpeed=6
set pOffStage = -999
set pTheSprite = the currentSpriteNum
set the ink of sprite the currentSpriteNum to 32
set pStartVal = 100
end
on turnOn me
set pSwitch = TRUE
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA