请选择 进入手机版 | 继续访问电脑版
查看: 261|回复: 0

转:常用的几个director脚本

[复制链接]

91

主题

95

帖子

430

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
430
发表于 2022-9-10 17:23:50 | 显示全部楼层 |阅读模式
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=pSprite.member.name

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的补充:
课件素材:https://ysp0828.taobao.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|苏州奇乐多媒体

Copyright © 2001-2013 Comsenz Inc.Template by Comsenz Inc.All Rights Reserved.

Powered by Discuz!X3.4( 苏ICP备13057363号 )QQ

快速回复 返回顶部 返回列表