Attach this Behavior to the buttons to control the Flash Sprite like Play, Pause, Rewind.
--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
--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
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA