Simple Flash Sprite Controller
______________________________________________________________________________________________

--Simple Flash Controller Behavior-----------------------------
------------------------------- Written on Feb 20th 2002
------www.Run4Fx.com------------------------------------
-------------------------------tushonline@hotmail.com---


Property pSprite -- this is used for Selecting your Flash Sprite Number
Property pEvent -- this is used for Controlling the Flash Sprite

on getPropertyDescriptionList me
tSpriteList = []
repeat with i = 1 to 100
tSpriteList.add(i)
end repeat

list = [:]

addProp list, #pSprite, [#comment: "Choose a Flash Sprite", #format: #integer,#default: "1", #range: tSpriteList]
addProp list, #pEvent, [#comment: "What to do", #format: #string,#default: "Pause", #range: ["Play","Pause","Rewind"]]

return list
end

--This Checks if the Sprite you want to control is a Flash Sprite or not.
On PrepareFrame me
if sprite (pSprite).member.type = #Flash then nothing
else
alert "ERROR : Sprite You selected is not a Flash Sprite.*_*"
halt
end if
end

-- This Event Makes ur Flash Sprite to Play, Pause or Rewind
on mouseUp me
-- The user clicked on a sprite
if pEvent = "Play" then play (sprite pSprite)
else
if pEvent = "Pause" then pause (Sprite pSprite)
else
if pevent = "Rewind" then rewind (sprite pSprite)
end if
end if
end

end mouseUp

-- This Detects your Sprite type & attaches the Behavior,[No chance for Frame Scripts here]
on isOKToAttach (me, aSpriteType, aSpriteNum)

tIsOK = 0
if aSpriteType = #graphic then
tIsOK = 1
end if

return(tIsOK)
end on

-- Behavior Description
on getBehaviorDescription me
return "Simple Flash Controller" & return & "Use this behavior to Play, Pause, Rewind your Flash Sprites" & return & "Attach this Behavior to your Buttons" &return& "www.run4fx.com"&return&"Tushar - tushonline@hotmail.com"
end

-- Behavior ToolTip
on getBehaviorTooltip me
return "Simple Flash Controller" & return & "Use this behavior to Play, Pause, Rewind your Flash Sprites" & return & "Attach this Behavior to your Buttons"
end