-- Events --
on EnterFrame me
if WhereTo = "On EnterFrame" then
controlDirectoStage
end if
end EnterFrame

on ExitFrame me
if WhereTo = "On EnterFrame" then
controlDirectoStage
end if
end ExitFrame

on MouseUp
if WhereTo = "On MouseUp" then
controlDirectoStage
end if
end MouseUp

on MouseDown
if WhereTo = "On MouseDown" then
controlDirectoStage
end if
end MouseDown

on MouseEnter
if WhereTo = "On MouseEnter" then
controlDirectoStage
end if
end MouseEnter

on MouseLeave
if WhereTo = "On MouseLeave" then
controlDirectoStage
end if
end MouseLeave

-- Custom Handler to set the DirectToStage Property --
on controlDirectoStage
if member (sprite(WhichSprite).member).type = #animgif then
member (sprite(WhichSprite).member).DirectToStage = DirectToStageProp
end if
end
-- Custom Handler to set the DirectToStage Property --