---- written for Director 8 ---
---- Kumar.K kumark@icode.com ----
------ Custom Properties ------
property DirectmediaSprite,MyAction
------ Events ------
on prepareframe
if the loop of member (sprite(DirectmediaSprite).member) = true then
set the loop of member (sprite(DirectmediaSprite).member) to false
end if
end
on ExitFrame me
if member (sprite(DirectmediaSprite).member).type = #TBDIRECTMEDIA then
if the currenttime of sprite(DirectmediaSprite) < the duration of member sprite(DirectmediaSprite).member then
go the frame
else
case(MyAction) of
"Go to NextFrame": Go the Frame+1
"Go to Next Marker": Go Next
"Go Previous Marker": Go previous
"Go Loop": Go Loop
"Quit": quit
end case
end if
end if
end ExitFrame
------ Events ------
------ Get Behaviour Description List ------
on getBehaviorDescription me
return
"This Behavior will hold on the frame till the specified DirectMedia Sprite " & RETURN &
"Finishes Playing." & RETURN & RETURN &
"Parameters." & RETURN &
"* DirectMedia Sprite" & RETURN &
"* Action(go NextFrame or Go NextMarkeror Go Previous Marker or Go Loop or Quit)"
end getBehaviorDescription
------ Get Behaviour Description List ------
------ Get Behavior Description List ------
on getPropertyDescriptionList me
if the currentspritenum <> 0 then exit
thedirectmediaspritelist = searchDirectmediaSprites(me)
propslist=[:]
if thedirectmediaspritelist.count() > 0 then
SetaProp propslist, #DirectmediaSprite, [#comment:"Wait for Which Directmedia Sprite",#format:#integer,
#range: thedirectmediaspritelist,#default: thedirectmediaspritelist[1]]
else
SetaProp propslist, #DirectmediaSprite, [#comment:"Wait for Which Directmedia Sprite",#format:#integer,
#default: 1]
end if
SetaProp propslist, #MyAction, [#comment: "What Next?" ,#format:#String,
#range:["Go to NextFrame","Go to Next Marker","Go Previous Marker","Go Loop","Quit" ],#default:"Go to NextFrame"]
return propslist
end getPropertyDescriptionList
------ Get Behavior Description List ------
------ Can be attached to only Frame script ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
case aSpriteType of
#script:
return true
end case
end if
end isOKToAttach
------ Can be attached to only Frame script ------
------ Search for DirectMedia Member on the Stage ------
on searchDirectmediaSprites me
set thedirectmediaspritelist = []
repeat with i=1 to the lastchannel
if sprite(i).member.type = #TBDIRECTMEDIA then
thedirectmediaspritelist.append(i)
end if
end repeat
return thedirectmediaspritelist
end
------ Search for DirectMedia Member on the Stage ------
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA