常用的几个director脚本
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
[Director] 常用的几个director脚本
1.调整分辨率至显示器大小
on exitFrame me
_movie.stage.drawRect = _system.deskTopRectList[1]
_movie.stage.rect = _system.deskTopRectList[1]
end
2.到达随机桢
on exitFrame me
global i
i=random(10,12)
go to frame i
end
3.播放音频
on exitFrame me
sound playFile 3, "1.mp3"
go to frame 25
end
4.第三声道音频住
on exitFrame me
sound(3).stop()
end
5.播放影片album
on exitFrame me
play movie "moviefile\album"
end
6.告知影片所在的路径的下一目录为MOVIEFILE
on startMovie
append the searchPaths, the moviePath & "moviefile"
end
7.使胶片环停止与运行
property ppause,pframe
on beginsprite me
ppause=false
pframe=1
end
on mouseEnter me
ppause=not ppause
if ppause then
tell sprite(me.spriteNum) to pframe=the frame
end if
end
on exitframe me
if ppause then
if pframe=1 then
tell sprite(me.spriteNum) to go to the lastframe
else
tell sprite(me.spriteNum) to go to pframe-1
end if
end if
end
on mouseLeave me
ppause=not ppause
if ppause then
tell sprite(me.spriteNum) to pframe=the frame
end if
end
8.精灵跟随鼠标移动
property ptuodong
on beginSprite me
ptuodong = FALSE
end
on mouseDown me
ptuodong = TRUE
end
on mouseUp me
ptuodong = FALSE
end
on mouseUpOutside me
ptuodong = FALSE
end
on exitFrame me
if ptuodong then
moveAmount = the mouseLoc - sprite(me.spriteNum).loc
sprite(me.spriteNum).loc = sprite(me.spriteNum).loc + moveAmount
sendSprite(sprite 2,#move,moveAmount)
end if
end
9.随机播放(外部)音乐
on startmovie
global i
i=random(1,5)
if(i=1) then
sound playfile 1,"音乐/1.mp3"
end if
if(i=2) then
sound playfile 1,"音乐/2.mp3"
end if
if(i=3) then
sound playfile 1,"音乐/3.mp3"
end if
if(i=4) then
sound playfile 1,"音乐/4.mp3"
end if
if(i=5) then
sound playfile 1,"音乐/5.mp3"
end if
end
9-2.随机连续播放(外部)音乐
on exitFrame me
go the frame
global k
if soundBusy(1) then
go to the frame
else
j=random(10)
if j=k then
j=random(10)
else
case j of
1:sound playfile 1,"音乐/1.mp3"
2:sound playfile 1,"音乐/2.mp3"
3:sound playfile 1,"音乐/3.mp3"
4:sound playfile 1,"音乐/4.mp3"
5:sound playfile 1,"音乐/5.mp3"
6:sound playfile 1,"音乐/6.mp3"
7:sound playfile 1,"音乐/7.mp3"
8:sound playfile 1,"音乐/8.mp3"
9:sound playfile 1,"音乐/9.mp3"
10:sound playfile 1,"音乐/10.mp3"
end case
k=j
end if
k=j
end if
end if
end
10.声音播放按钮与声音文件的调用(限调用演员内部精灵)
on mousewithin me
cursor 280
sprite(13).member=member("dvd61") 播放到该精灵所在位置时,播放按钮显
示为(调用精灵)"dvd61"
end
on mouseup me
if sound(1).isbusy() then
sound(1).stop()
else
sound(1).play(member("bg")) 在第一声道播放(调用)演员文件"bg"
end if
end
on mouseleave me
cursor 0
sprite(13).member=member("dvd6") 播放到该精灵所在位置时,播放按钮显示为(调用精灵)"dvd6"
end
11.设置精灵的(宽)和(高)数值
global i
on startmovie
sprite(2).width=490
sprite(2).height=368
end
12.跳转到上一个标记
on rightMouseDown me (当鼠标右键按下时)
go to previous
end
12.跳转到下一个标记
on mouseUp me
go to next
end
13.如何制作光盘自动远行
[autorun]
open=projectorname.exe
icon=icon.ico
更改projectorname使之与你的exe名一样,并可加上路径如
open=stuff\projector.exe
14.播放外部影片
on exitFrame me
_movie.newMember(#"33.avi")
end
15、对胶片环的控制。点击暂停,再次点击则继续。
property ppause,pframe
on beginsprite me
ppause=false
pframe=1
end
on mouseup me
ppause=not ppause
if ppause then
tell sprite(me.spriteNum) to pframe=the frame
end if
end
on exitframe me
if ppause then
if pframe=1 then
tell sprite(me.spriteNum) to go to the lastframe
else
tell sprite(me.spriteNum) to go to pframe-1
end if
end if
end
16.播放和暂停按钮控制声音
on mouseup me
pSprite=sprite(me.spritenum)
pMemberName=
if pMemberName = "播放按钮" then
sound(1).play()
sprite(me.spritenum).member = member
("暂停按钮")
else
sound(1).pause()
sprite(me.spritenum).member = member
("播放按钮")
end if
updateStage
end
17.定制光标(把要用的光标放到演员栏内)
on exitFrame me
Cursor(member 要用的光标)
end
对1的补充: