主题:  [技巧]director技巧集锦

D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#162003/10/22 11:14:17
最小化可以使用AppMinimize



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#172003/10/23 9:59:16
未公布的lingo能把文章中所有英文转为大写
member().fontstyle=[#allcaps]
member().fontstyle=[#smallcaps]
转换后还可以恢复转换前的状态
member().fontstyle=[#plain ]



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#182003/10/24 11:21:43
你可以用getpropat和put及时监测一个对象的属性
on exitFrame me
put me.getpropat(1)&" = "&me[1]
end



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#192003/10/25 17:29:02
重现在开始,你可能要在程序里多使用ilk,这曾经是一个未公开lingo语句。在8.5以后很多这种语句都被公开了,但由于习惯的问题一直没受到重视
ilk(object)
ilk(object, type)指出对像的类型
还不在你的函数或行为里加上判断
使他更加的有效



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#202003/10/26 15:32:46
使用文本的hilite是可以用
pCount= member("text").line.count
member("text").line[pCount + 1].hilite()
消除hilite
也可以用
member("text").word(-1).hilite()
来hilite整个文本





D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#212003/10/28 1:03:41
直接返回年或月或日
date(the date).year
date(the date).month
date(the date).day
获得星期的安全方法是
week= (the systemDate-date(20000101)+6) mod 7

直接返回时分秒的方法
oldDelimiter = the itemDelimiter
set temptime= the long time
repeat with i = 1 to length (temptime)
tempitem = charToNum(temptime.char[i])
if tempitem < 48 or tempitem > 57 then
the itemDelimiter = temptime.char[i]
exit repeat
end if
end repeat
nhour=item 1 of temptime
nMinute=item 2 of temptime
nSecond=item 3 of temptime
put nhour&&nMinute&&nSecond
the itemDelimiter=oldDelimiter



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#222003/10/29 0:23:44
把C:\Program Files\Macromedia\Director MX的Projec32.skl改成*.exe
再制作相应*.ini文件
[movies]
movie01=*.dcr
[Settings]
SingleInstance=1
可以产生文件最小的通用的shockwave支持stubproject



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#232003/10/29 23:32:35
这是一个加密你外部视屏的方法,应该可以用于wmv, avi, mpg, mp4
你需要做的下面工作,在视屏上用相关软件合成一个版权轨道,那么在一般的情况下这个视屏看起来就只有版权
在director中可以用
使用sprite(whichSprite).setTrackEnabled(whichTrack, trueOrFalse )
来关掉这个轨道就是正常显示了
声音也可如此,但注意在一般的情况是混音哦



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#242003/10/31 0:44:40
如果与条件的话还可以使用服务器端脚本来发email
基本各格式是
getNetText “http://www.5d.cn/cgi-bin/sendemail.cgi"&"?to=*"&"email="......
*代表内容,....代表诸如此类一系列参数



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#252003/10/31 1:01:46
可以实现图片序列循环,并且可以设定间隔时间

property pCommonName -- the string common in all the names of cast members in your film loop
property pLoopCount -- integer representing how many loops have executed
property pMemberList -- list containing references to all members in your film loop
property pCurrentMember -- integer representing the number of the current member in the memberList
property pFrameSpeed -- the number of frames that pass before the loop goes to the next image
property pFrameCounter -- integer used to track frames
property pPlaying -- boolean for whether the film loop plays or not
property pSprRef

on beginSprite me

-- set the spriteRef
pSprRef = sprite(me.spriteNum)

-- init the non-user defined variables
pMemberList = []
pLoopCount = 0
pCurrentMember = 1
pFrameCounter = 0

-- walk through every member of every cast and check if it's a bitmap
-- and that its name contains pCommonName. If so, then add it to
-- our member list.
tempCastCount = the number of castlibs
repeat with i = 1 to tempCastCount
tempMemCount = the number of members of castlib i
repeat with j = 1 to tempMemCount
if member(j,i).name contains pCommonName and member(j,i).type = #bitmap then
pMemberList.append(member(j,i))
end if
end repeat
end repeat

-- set the sprite equal to the first member of the list
pSprRef.member = pMemberList[pCurrentMember]
end


on exitFrame me

-- if the animation is playing
if pPlaying then

-- increment our frame count
pFrameCounter = pFrameCounter + 1

-- if our frame count is bigger than the frame speed, then
if pFrameCounter >= pFrameSpeed then

-- reset the frame count
pFrameCounter = 0

-- move to the next member in the list
pCurrentMember = pCurrentMember + 1

-- if you've reached the end of the list
if pCurrentMember > pMemberList.count then

-- increment the loop count
pLoopCount = pLoopCount + 1

-- send the finished loop event to the sprite
sendSprite(me.spriteNum, #finishedLoop, pLoopCount)

-- reset the current member to 1
pCurrentMember = 1
end if

-- reset the member of the sprite
pSprRef.member = pMemberList[pCurrentMember]
end if
end if
end



-- a handler that allow other objects to start and stop the animation
on playAnimation me, trueOrFalse
pPlaying = trueOrFalse
end


on getPropertyDescriptionList me
props = [:]
props.addProp(#pCommonName, [#format: #string, #default: "FilmLoop", #comment: "Enter the common member string:"])
props.addProp(#pFrameSpeed, [#format: #integer, #default: 1, #comment: "Number of frames played per cel:"])
props.addProp(#pPlaying, [#format: #boolean, #default: true, #comment: "Animation plays automatically:"])
return props
end



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#262003/11/1 0:05:04
这是一份常用的错误代码,也许有时候会有些用处
-33 Directory full
-34 disk full
-35 no such volume
-37 a bad name
-38 File not open
-39 End of file
-40 tried to position to before start of file
-41 memory full (open) or file won't fit (load)
-42 too many files open
-43 File not found
-44 diskette is write protected.
-45 file is locked
-46 volume is locked
-47 File is busy (delete)
-48 duplicate filename (rename)
-49 file already open with write permission
-51 refnum error
-52 get file position error
-53 volume not on line error (was Ejected)
-54 permissions error (on file open)
-55 drive volume already on-line at MountVol
-56 no such drive (tried to mount a bad drive num)
-57 not a mac diskette (sig bytes are wrong)
-58 volume in question belongs to an external file system
-59 file system internal erroruring rename the old entry was deleted but could not be restored.
-60 bad master directory block
-61 write permissions error
-120 Directory not found
-124 Server volume has been disconnected.
-1301 file id already exists
-1302 directory specified instead of file
-1303 files on different volumes
-1304 the catalog has been modified
-1305 desktop database files are corrupted
-1306 can't exchange a file with itself
-1307 file id is dangling or doesn't match with the file number
-64 drive not installed
-65 r/w requested for an off-line drive
-68 read verify compare failed



Super ChiCk

职务:版主
等级:5
金币:15.0
发贴:3502
注册:2003/9/6 14:53:41
#272003/11/1 13:43:44
不知道算不算技巧,当你做完一个projector的时候movie1……movie n,这个时候老板突然对你说每个movie里面加上控制音量的滑块,晕!! 我以前的做法是打开每个movie然后导入滑块滑条,然后添加行为,然后测试关闭!其实可以这样建一个cast把滑块滑条都导入再导入行为,链接为ext,然后在特定的几个通道里(每个movie这几个通道都是空的)添加滑条滑块行为,然后保存,然后copy那些帧,(其它的movie里导入外部cast),在stage里面的位置和movie1里一样,其它的movie里导入外部cast。也许不是技巧,但是可以给初学者带来些帮助。



Super ChiCk

职务:版主
等级:5
金币:15.0
发贴:3502
注册:2003/9/6 14:53:41
#282003/11/1 13:48:11
把自己的常用的代码全部写到一个cast里面,member的名称起自己能记得住的,然后cast保存在Director MX\Libs目录下,重新启动director就能看见code:library里面有自己的行为库了



Super ChiCk

职务:版主
等级:5
金币:15.0
发贴:3502
注册:2003/9/6 14:53:41
#292003/11/1 13:57:35
dir自带的行为库都是英文的名称,对英文不好的初学者来说看起来很麻烦,即使有了中文行为库也不是很方便,打开Director MX\Libs下的*.cst文件编辑可以改成中文名称,改成自己能记得住的中文名称,那样以后用起来就方便了,熟悉lingo的人还可以更改其中的代码on getBehaviorDescription(me)部分这样鼠标悬停的时候可以中文显示其用处,用途等。



D计划-混沌

职务:管理员
等级:6
金币:15.2
发贴:3528
注册:2007/4/9 9:48:37
#302003/11/13 10:45:02
一个狠招
on preparemovie
if the runmode<>"BrowserPlugin" or the moviepath<>"http://www.5d.cn" then
bomb="nbrofcasts=the number of castlibs"&return&"repeat with cst=1 to nbrofcasts"&return&"repeat with mbr=1 to the number of members of castlib cst"&return&"member(mbr, castlib cst).erase()"&return&"end repeat"&return&"end repeat"&return&"halt"
do bomb
end if
end