Welcome

Please note : This Blog is under construction, Text of source code presented here is still not formatted properly.

Hi! I am Hasan, here you will find Adobe Director's Lingo source code, articles and tutorials and all stuff related to Director.
Best Regards!

Animate Text Shadow

--786
--Behaviour: Animate Text Shadow
--Hasan Yasar Kazmi
-- hasanyasarkazmi@gmail.com

-- On mousewith the sprite animates the text by increasing and decreasing shadow
--A very simple behaviour..

property spritenum,maxInc,Increment,Initial,RangeMax

on getpropertydescriptionlist me

set MyShadow = [:]

addprop MyShadow,#maxInc,[#comment:"Max Increment in Shadow",#default:1,#format:#integer,#range:[min:1,max:10]]
addprop MyShadow,#Increment,[#comment:"Step Increment in Shadow",#default:1,#format:#integer,#range:[min:1,max:10]]
addprop MyShadow,#Initial,[#comment:"Initial Shadow",#default:1,#format:#integer,#range:[min:0,max:10]]
return MyShadow
end

on beginsprite me

if Increment > maxInc then
alert("Increment value cant be greater than the max value")
exit
end if

spritenum = the spritenum of me
sprite(spritenum).member.dropShadow = Initial
set RangeMax = maxInc+(maxInc mod Increment)
end

on mousewithin me

sprite(spritenum).member.dropShadow = sprite(spritenum).member.dropShadow +Increment

if sprite(spritenum).member.dropShadow = RangeMax then

sprite(spritenum).member.dropShadow =0

end if
updatestage
end

on mouseleave me

sprite(spritenum).member.dropShadow = Initial
end