主题:  怎么控制avi电影的停止、播放、和全屏

alongyan

职务:普通成员
等级:1
金币:0.0
发贴:7
#12004/1/15 18:07:38
急!



我是小马

职务:普通成员
等级:3
金币:17.0
发贴:794
#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



段氏

职务:普通成员
等级:1
金币:1.0
发贴:196
#32004/1/16 17:20:05
video 控制 --(假设 video 在 sprite 1 )--video播放(paly),暂停,倒转,从头播-- 播放键--on mouseDownset the movieRate of sprite 1 to 1 end --暂停键-- on mouseDownset the movieRate of sprite 1 to 0 end --倒转键--on mouseDownrepeat while the mouseDownif (the movieTime of sprite 1 >= the duration of member 1) or (the movieTime of sprite 1=0) thenset the movieRate of sprite 1 to 0repeat while the mouseUpnothing end repeatplay frame 1 --回到播放此video的frame开始处 elseset the movieRate of sprite 1 to -1end if end repeatset the movieRate of sprite 1 to 1 end--从头播放-- on mouseDown set the movieTime of sprite 1 to 0 set the movieRate of sprite 1 to 1 end 在movie间跳转 go to frame 10 of movie "game1" go to "maker1" of movie "movie1" go to movie "movie1"