home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boot Disc 2
/
boot-disc-1996-10.iso
/
Demo.dir
/
00039_Script_VideoBtnClass
< prev
next >
Wrap
Text File
|
1996-08-09
|
4KB
|
142 lines
property spritenum,castname,videoBtnPlay,videoBtnPlayDown
property videoBtnStop,videoBtnStopDown,videoBtn,videosprite
property canVideoPlay,IsPlaying,IsPending,videocast
on new me,myvideosprite,mycastname
set videosprite=myvideosprite
if not (the visible of sprite videosprite) then
set the visible of sprite videosprite to false
end if
global videoBtns
set videoBtns=me
if voidP(mycastname) then
set castname="videoBtn"
else
set castname=mycastname
end if
set canVideoPlay to false
set IsPlaying to false
set spritenum=castsprite(me,castname)
puppetsprite spritenum,true
set videoBtnPlay=the number of member (castname&"Play")
set videoBtnPlayDown=the number of member (castname&"PlayDown")
set videoBtnStop=the number of member (castname&"Stop")
set videoBtnstopDown=the number of member (castname&"StopDown")
set videoBtn=the number of member castname
set olddelimiter=the itemdelimiter
set the itemdelimiter=quote
repeat with index=1 to count(the actorlist)
set obj=getat(the actorlist,index)
if item 2 of string(obj)="VideoBtnClass" then
deleteat the actorlist,index
exit repeat
end if
end repeat
set the itemdelimiter=oldDelimiter
add the actorlist,me
return me
end
on setstate me,canMyVideoPlay
set canVideoPlay=canMyVideoPlay
set IsPlaying=false
set IsPending=true
end
on stepframe me
if canVideoPlay then
if IsPlaying then
if the mousedown and rollover(spritenum) then
if not IsPending then
if the membernum of sprite spritenum<>videoBtnStopDown then
set the membernum of sprite spritenum to videoBtnStopDown
updateStage
set IsPending to true
end if
end if
else
if IsPending then
if the membernum of sprite spritenum<>videoBtnStop then
stopVideo me
set the membernum of sprite spritenum to videoBtnStop
updateStage
set IsPending to false
end if
end if
end if
else
if the mousedown and rollover(spritenum) then
if not IsPending then
if the membernum of sprite spritenum<>videoBtnPlayDown then
set the membernum of sprite spritenum to videoBtnPlayDown
updateStage
set IsPending to true
end if
end if
else
if IsPending then
if the membernum of sprite spritenum<>videoBtnPlay then
PlayVideo me
set the membernum of sprite spritenum to videoBtnPlay
updateStage
set IsPending=false
end if
end if
end if
end if
else
if the membernum of sprite spritenum<>videoBtn then
set the membernum of sprite spritenum to videoBtn
set the visible of sprite videosprite to false
updateStage
set isPending=false
set isPlaying=false
end if
end if
global gStatus
status gStatus
end
on playVideo
set IsPlaying to true
set the visible of sprite videosprite to false
set the movietime of sprite videosprite to 0
set the movierate of sprite videosprite to 0
global resources
set the targetticks of resources to the shortinterval of resources+the ticks
end
on stopVideo
set IsPlaying to false
puppetsound 0
set videocast=the membernum of sprite videosprite
global resources
set the filename of member videocast to getBasePath(resources)&(the dvpath of the activerec of resources)
set the movietime of sprite videosprite to 0
set the movierate of sprite videosprite to 1
set the visible of sprite videosprite to true
global resources
set the targetticks of resources to (the duration of member videocast)+the ticks
-- halt the video
end
on dispose me
set the visible of sprite videosprite to false
set the membernum of sprite spritenum to videoBtn
updateStage
puppetsprite spritenum,false
end
on castsprite me,whichcast
set curcast=the number of member whichcast
set spritenum=0
if curcast>0 then
repeat with index=1 to 48
if the membernum of sprite index=curcast then
set spritenum=index
exit repeat
end if
end repeat
end if
return spritenum
end