on beginsprite me
mysprite=sprite(me.spritenum)
icastnum=the castnum of mysprite +1
myloch=mysprite.loch
end beginsprite me
on mousewithin me
put 1 into f
end
on mouseleave me
put(0) into f
end
on exitframe me
if f=1 then
if the loch of mysprite set the loch of mysprite to the loch of mysprite+5
set the castnum of mysprite to icastnum
end if
end if
if f=0 then
if the loch of mysprite>myloch then
set the loch of mysprite to the loch of mysprite-5
set the castnum of mysprite to icastnum-1
end if
end if
end