#22004/1/15 18:39:24
用一个行为来控制数字电影的播放,可实现播放、倒带、快进、快退、暂停、循环等
property pControlType, pVideoSprite
on getpropertydescriptionlist
mylist = [:]
addprop mylist, #pControlType, [#comment:"Control Type:",#format:#symbol,#range:[#play,#stop,\ #pause, #stepForward,#stepReverse,#reverse,#start,#end,#fastForward,#fastReverse,#loop],#default: \ #stop]
addprop mylist,#pVideoSprite,[#comment:"Video sprite :",#format:#sprite,#default:1]
return mylist
end
on mouseUp me
case pControlType of
#play:
sprite(pVideoSprite).movieRate = 1
#stop:
sprite(pVideoSprite).movieRate = 0
sprite(pVideoSprite).movietime = 0
#pause:
sprite(pVideoSprite).movieRate = 0
#stepForward:
sprite(pVideoSprite).movietime = sprite(pVideoSprite).movietime + 4
#stepReverse:
sprite(pVideoSprite).movietime = sprite(pVideoSprite).movietime - 4
#reverse:
sprite(pVideoSprite).movieRate = -1
#start:
sprite(pVideoSprite).movieRate = 0
sprite(pVideoSprite).movietime = 0
#end:
sprite(pVideoSprite).movieRate = 0
sprite(pVideoSprite).movietime = sprite(pVideoSprite).duration
#fastForward:
sprite(pVideoSprite).movieRate = 3
#fastReverse:
sprite(pVideoSprite).movieRate = -3
#loop:
sprite(pVideoSprite).member.loop = not sprite(pVideoSprite).member.loop
end case
end