:director常见问题整理10

来源:百度文库 编辑:九乡新闻网 时间:2024/05/03 08:57:34
Q:常用声音Lingo。
A:

channe1Count
语法: the channe1Count of member whichCastMember
用途: 此属性返回声音造型成员所使用的声音通道数。
举例: put the channe1Count of member”Jazz”

currentTime
语法: the currentTime of sprite whichSprite
用途: 此属性确定了声音或视频精灵当前正在播放的时间,以毫秒为单位。
举例: set the text of member”time” to (the currentTime of sprite l0)/ 1O00

multiSound
语法: the multiSound
用途: 如果现在系统支持两个或两个以上的声音通道时,就返回TRUE。
举例: if the multiSound then sound playFile 2,”Music”

puppetSound
语法: puppeiSound whichChanne1,”whichCastMember”
puppetSound whichChanne1,0
用途: 此命令用来播放声音造型成员或是停止播放造型成员。
举例: puppetsound 1,”Wind”
puppetSound 2,0

sampleSize
语法: the sampleSize of member whichCastmember
用途: 此属性返回造型成员的采样大小,通常是8位或是16位。
举例: set soundSize = the sampleSize of member”Voice Over”

SoundBuSy
语法: soundBusy(whichChannel)
用途: 此函数用来判断声音通道是否正在播放声音。
举例: if soundBusy(1) then go to the frame

soundEnab1ed
语法: the soundEnab1ed
用途: 此属性用来决定声音是否打开,如果为TRUE,就可以听到声音,如果为FALSE,虽然音量不变,但是却听不到声音。
举例: set the soundEnab1ed to TRUE

sound Close
语法: sound c1ose soundChannel
用途: 用来关闭某个声音通道中的声音播放,最好是使用puppetSound命令来代替它。
举例: sound c1ose l

fadeln
语法: sound fadeln whichChanne1, ticks
用途: 以指定的ticks时间使声音通道中的声音渐强,如果没有指定ticks值,就以15*(60/(Tempo seiiing))为时间,其中的Tempo setting为当前帧速度。
举例: sound fadeIn 1.5 * 60

fadeOut
语法: sound fadeOut whichChanne1, ticks
用途: 以指定的时阳j使声音通道中的声音渐弱。
举例: sound fadeOut 1.5 * 60

playFile
语法: sound playFile whichChanne1, whichFile
用途: 此命令用来播放外部AIFF和WAVE声音文件,如果声音文件和电影文件不在一个目录中,要为电影名加上全路径。
举例: sound playFile 3, the pathName&”Thunder”

volume
语法: the vo1ume of sound whichChannel
用途: 此属性用来决定声音通道的音量大小,以0.255之间的数值表示。0表示静音, 255表示音量最大。
举例: set the volume of sound 2 to l30

bitRate
语法: the bitRate of member whichCastmember
用途: 此属性返回了下载的Shockwave Audio的波特率,以Kbps为单位。
举例: put the bitRate of member”prima”

bitsPerSample
语法: the bitsPerSample of member”whichCastmember”
用途: 此属性返回了转换到Shockwave Audio之前的声音的位数。
举例: put the bitsPerSample of member”paul Robeson”

percentStreamed
语法: the percentStreamed of member”whichCastmember”
用途: 此属性用来指示一个Shockwave Audio已经下载的百分比。
举例: put the percentStreamed of member”Charles”

percentPlayed
语法: the percentPlayed of member”whichCastmember”
用途: 此属性用来指示一个Shockwave Audio已经播放的百分比。
举例: put the percentPlayed of member”Frank”

preloadBuffer
语法: preLoadBuffer member”whichCastmember”
用途: 此命令将一个Shockwave Audio预先加载到内存中。
举例: preLoadBuffer (member”Torme”)

preloadTime
语法: preLoadTime of member whichCastmember
用途: 此属性决定在电影播放之前使用流技术下载的Shockwave Audio的时间。
举例: set the preLoadTime of member”Louis”=6

soundChannel
语法: the soundChanne1 of member“whichCastmember”
用途: 此属性决定了声音造型成员播放的声音通道。
举例: set the soundChanne1 of member”Frank”to 3

state
语法: state of member”whichCastmember”

用途: 此属性指示了Shockwave Audio的状态:
0 停止
1 正在下载
2 下载完成
3 正在播放
4 暂停
5 完成
9 出现错误
10 CPU资源不足
举例:
if the state of member”Ella Fiizgerald”:9 then
alert "Sorry,this is an erro"
end if


用途: 此属性指示了Shockwave Audio的状态:
0 停止
1 正在下载
2 下载完成
3 正在播放
4 暂停
5 完成
9 出现错误
10 CPU资源不足
举例:
if the state of member”Ella Fiizgerald”:9 then
alert "Sorry,this is an erro"
end if


常用精灵属性Lingo

blend
语法: the blend of sprite whichSprite
用途: 此属性决定了精灵的混合百分比
举例: set the blend of sprite 3 to 40


bottom
语法: the bottom of sprite whichSprite
用途: 此属性决定了精灵矩形边框的下部边缘的坐标值,这个属性可以用来测试但是不能直接修改
举例: set lowest = put the botiom ofsprite (i + l)


castLibNUm
语法: the castLibNum of sprite whichSprite
用途: 此属性决定了精灵所使用的造型成员的Cast表的编号,可以被测试和修改。如果更改此属性但是不修改castnum属性, Director会使用原来的造型成员编号在新的Cast表中为精灵寻找造型成员
举例: set the castLibNum of sprite 3 to the number ofcastlib“Newcast”

constrainH
语法: constrainH(whichsprite, va1ue)
用途: 此函数首先计算表达式va1ue的值,然后和精灵的左右矩形边缘坐标进行比较。如果表达式在精灵左右矩形边缘之间,就返回这个表达式;如果这个表达式小于精灵矩形边缘的左边的坐标值,就返回精灵矩形左边边缘的坐标值;如果表达式大于精灵矩形边缘右边的坐标值,就返回精灵矩形右边边缘的坐标值
举例: put constrainH(1, 20)
--30
put constrainH(1,60)
--60
put constrainH(1,100)

constrainV
语法: constrainV(whichsprite, va1ue)
用途: 和constrainH类似,但是是和精灵矩形边枢的上下边缘进行比较。
举例: set the locV of sprite l to constrainV(3,the mouseV)

constraint
语法: the constraint of sprite whichSprite
用途: 此属性可以将一个精灵的移动范围限制在另一个精灵的矩形范围之内。
举例: set the constraint of sprite l to 2

cursor
语法: the cursor of sprite
用途: 此属性决定了鼠标在指定的精灵上面的时候使用的光标形状。
举例: set the cursorofsprite 20 to 4

editable
语法: the editable of sprite whichSprite
用途: 此属性决定了字段精灵是否能在电影播放期间被编辑。
举例: set the editable ofsprite 5 to TRUE

foreColor
语法: the foreColor of sprite whichSprite
用途: 此属性决定了精灵的前景色,但是只有在1位颜色深度的位图精灵和形状精灵上才会是精灵显示发生改变,就像在工具栏中选择了前景色一样。
举例; set the foreColor of sprite l0 to 36

height
语法: the height of sprite whichSprite
用递: 此属性决定的是精灵的垂直高度,以像素为单位。
举例: set the height ofsprite l0 to 26

ink
语法: the ink of sprite whichSprite
用途: 此属性决定的是精灵的颜料类型,其有效的颤料类型值如下:
0——Copy
1——Transparent
2——Reverse
3——Ghost
4——Noi copy
5——Not transparent
6——Not reverse
7——Not ghost
8——Matte
9——MaSk
32——Blelfld
33——Add pin
34——Add
35——Subtract pin
36——Background transparent
37——Lighiesi”
38——Subtract
39——Darkelst
举仔个set the ink of sprite l to 8

left
语法: the left of sprite whichSprite
用途:此属性决定了精灵矩形边框的左边框的坐标。
举例: set vLowest = the left of sprite (i + l)
lineSize
语法: the lineSize of sprite whichSprite
用途:此属性决定了形状精灵的线宽类型,以像素为单位。
举例: set the lineSize ofsptiie 4 to 3

loc
语法: the loc of sprite whichSprite
用途:此属性决定了精灵的注册点的坐标,其值是一个点坐标
举例: put the loc ofsprite 6
--point(50, 100)

locH
语法: the locH of sprite whichSprite
用途:此属性决定了精灵注册点的水平位置。
举例: set the locH ofsprite l5 to the mouseH

locV
语法: the locV of sprite whichSprite
用途:此属性决定了精灵注册点的垂直位置。
举例: set the locV ofsprite l5 to 240

member
语法: ihe member of sprite whichSprite
用途:此属性决定了精灵所使用的造型成员和其Cast表。
举例: set the member ofsprite l5 = member 3 ofcastLib 4

memberNum
语法: the memberNum of sprite whichSpriie
用途:此属性仅仅决定精灵所使用的造型成员,而不决定造型成员所在的Cast表
举例: set the memberNum of sprite 3 to 35

moveableSprite
语法: the moveableSprite of sprite whichSprite
用途:此属性决定精灵是否能在电影播放期间被移动。
举例: set the moveableSprite of sprite 5 to TRUE

puppet
垮法: the puppet of sprite whichSprite
用途:此属性决定精灵所在的通道是否处于控制之下。
举例: sei the puppet ofsprite l to TRUE

rect
语法: the rect of sprite whichSprite
用途:此属性决定是精灵矩形边框的主上角和右下角的坐标值。
举例: put the rect of sprite 20

right
语法: the right of sprite whichSprite
用途:此属性决定了精灵矩形边框的右边框的水平坐标值。
举例: if the right of sprite 3 > (the stageRight-the stageLeft) then offRighiEdge

rotation
语法: the rotation of sprite whichSprite
用途:此属性决定了精灵的旋转角度。
举例:

repeat with i= l to 36
set the rotation of sprete 1=i*10
updatestage
end

scriptNum
语法: scripiNum of sprite whichSprite
用途:此属性决定了添加给精灵脚本的编号。
举例: put the s criptNum of sprite 4

scoreColor
语了去: the scoreColor of sprite whichSprite
用途:此属性决定了精灵在SCORE中的颜色。
举例: put the scoreColor of sprite 7

skew
语法:the skew of sprite whichSprite
用途:此属性决定了精灵的扭曲程度。
举例: set the skew of sprite l = 10

startTime
语法: the startTime of sprite whichSprite
用途:此属性决定了数字视频精灵的开始播放的时间,以ticks为单位。
举例: set the startTime ofsprite 5 to 20

stopTime
语法: the stopTime of sprite whichSprite
用途:此属性决定了数字视频精灵的结束播放的时间
举例: set the stopTime of sprite 5 to 1O0

top
语法: the top of spriie whichSpriie
用途:此属性决定了精灵矩形边框的顶部边框的垂直坐标。
举例: if the top of sprite 3 < 0 then offTopEdge

trails
语法: the trails of sprite whichSprite
用途:此属性决定了精灵的trails是否关闭,l代表打开,o代表关闭
举例: set the trails of sprite 3 to l

type
语法: the type of sprite
用途:此属性可以设置精灵的类型,现在可以将这个属性设为O来清除精灵通道。
举例: set the type of sprite l to 0

tweened
语法: the tweened of sprite
用途:此属性决定了新建精灵的单个帧是否为关键帧。如果这个属性为TRUE,只有新建精灵的第1帧为关键帧;如果是FALSE,则每一帧都是关键帧。
举例: set the tweened of sprite 2 to l

visible
语法:the visible of sprite whichSprite
用途:此属性决定了精灵的可见性。
举任d: set the visible of spriie 2 to TRUE

widih
语法: the width of sprite whichSprite
用途:此属性决定了精灵显示矩形边框的宽度大小,以像素为单位。
举例: set the width of sprite l0 to 26


Q:常用字段属性
A:
atignment
语法:the alignment of member whichCastmember
用途:此属性决定了字段文本的对齐方式,其有效值为Left, Right和Center。
举例: set the alignment of member“Field”to“left”

autoTab
语法: the autoTab of member whichCastmember
用途:此属性决定了可编辑的字段在电影播放期间是否可以通过Tab键来切换到下一个字段。
举例: set the autoTab of member,"Field" to TRUE

border
语法:the border of men1ber whichCastmember
用途:此属性决定了字段精灵周围的矩形边框的粗细,以像素为单位。
举例: set the border of member"Fleld" to l0

boxDropShadow
语法: the boxDropShadow of member whichCastMember
用途:此属性决定了字段精灵边框的阴影的大小,以像素为单位。
举例: set the boxDropShadow of member” Field” io l0

boxType
语法: the boxType of member whichCastmember
用途:此属性决定了字段精灵显示的种类,其有效值为#adjust, #scroll, #flxed和#limit。
举例: set the boxType of member” Field” to #scroll

editable
语法, the editable of member whichCastmember。
用途:此属性决定了字段精灵的可编辑性。
举例: set the editable of member“Answer”= TRUE

font
语法: the font of member whichCastmember
用途:此属性用来设置字段精灵的显示字体。
举例: set the font of line l of子member”Speaks” to“Arial”

fontSize
语法: the fontSize of member whichCastmember
用途:此属性用来设置字段精灵的字体大小。
举例: set the fontSize of line 2 of memberTpeaks” to l8

lineCount
语法:the lineCount of member whichCastMember
用途:此属性返回字段精灵的行数,但是不能直接设置这个属性。
举例: set numbeOfLines = the lineCount of member“Today”

lineHeight
语法: the lineHeight of member whichCastmember
用途:此属性决定了字段文本的行间距的大小。
举例: set oldHeight = the lineHeight of member” Speaks”

margin
语法: the margin of member whichCastmember
用途:此属性决定了字段内部的边缘空白的大小,以像素为单位。
举例: set the margin of member“News” to l5

pageHeight
语法: the pageHeight of membor whichCastmember
用途:此属性返回了舞台上整个字段精灵的高度大小,以像素为单位。
举例: put the pageHeight of membern“News”

scrollTop
语法: the scrollTop of member whichCastmember
用途:此属性决定了字段精灵顶部边缘到字段的距离。
举例: set the scrollTop of member”Credits=10

text
语法: the text of member whichCastmember
用途:此属性决定了字段精灵中的文本。
举例:if the text of member “Response”=EMPTY then
set the text of member“Response”to “Thank You”
end if

selEnd
语法:the selEnd
用途:此属性决定了字段中所选择部分的最后一个字符。
举例: set the selEnd to 5

selStart
语法:the selStart
用途:此属性决定了字段中所选择部分的第一个字符。
举例: if the selEnd = the selStart then noSelection

scrollByLine
语法: scrollByLine member whichCastmember, amount
用途:此命令将字段在垂直方向上进行滚动,其距离由amount的值决定,以行为单位。如果amount为正,就向下滚动,如果amount为负,就向上滚动。
举例: scrolIByLine member’, News,,,5scrollByPage
语)t: scrolIByPage member whichCasiMember, amount
用途:和scrolIByLine命令柑类似,只是滚动的时候是以页(字段精灵的大小)为单位。
举例: scrollByPage member”Today News,5

charPosToLoc
语法: charPosToLoc(member whichCastMember, nthCharacter)
用途: 此函数决定了字段中所指定的第nthCharacter个字符的位置点。
举例: set location to charPosToLoc(member“Headline”,50)

lineHeight
语法: lineHeight(member whichCasiMember,lineNumber)
用途: 此函数返回了字段中指定行的高度。
举例: set headline=lineHeight(menlber”News”,1)

linePosToLocV
语法: linePosToLocV(member whichCastMember, lineNumber)
用途: 此函数返回了字段中从顶部边缘到指定行的距离。
举例: set startOfString=1inePosToLocV(member,,News”,5)

1ocToCharPos
语法: 1ocToCharPos(member whichCastMember, 1ocation)
用途: 此函数返回在字段中距离指定的1ocation点最近的字符的序号,其中点的坐标是以字段的左上角为基准的。
举例: set n to locToCharPos(melnber"News",point( 100,1000))

1ocVToLinePos
语法: 1ocVToLinePos(member whichCastMember, 1ocV)
用途: 此函数返回距离字段顶部为1ocV的行数。
举例: put locVToLinePos(nleinber”News“, 150) into pageBreak




Q:网络lingo。
A:
BrowserName
类型:命令、属性、函数
句法:browserName myNewBrowser、Path put browserName()、browserName(#enable,True)
描述:作为一个命令,它使我们能够设定由gotoNetPage所使用的缺省浏览器;作为一个函数,使我们能够得到缺省浏览器的名称;作为属性,使我们能够决定是否随着g otoNetPage命令自动运行浏览器

clearCache
类型:命令
句法:clearCache
描述:清除Director或放映机的高速缓存里的内容

downloadNetThing(不能用于shockwave)
类型:命令
句法:GnetId=downloadNetThing
("http://www.hoperich.com/images/hoperich.jpg";,"hoperich.gif")
描述:把文件从因特网上的某一处传输到本地磁盘上,用netDone来检查该*作是否完成。由于安全的原因,它不能用于shockwave

getNetErrorString
类型:函数
句法:alert getNetErrorString(myNetError)
描述:从netError得到一个网络错误代码,并返回一段简短的字符串描述

getNetText
类型:函数
句法:getNetText("http://www.hoperich.com")/
描述:开始从因特网上搜索一个文本文件,它为该*作返回一个网络ID

getStreamstatus
类型:函数
句法:put getStreamStatus(gNetID)
描述:当给定网络ID或URL时,该函数返回一个关于流式传输进程的信息的列表。该列表中包括#url,#state,#bytesSoFar,#bytesTotal和# error

gotoNetMovie
类型:命令
句法:gotoNetMovie("http://www.hoperich.com/study/director_index.dcr" )
描述:从因特网上得到一部新影片,并取代当前的影片。第一部影片仍然继续播放,直到第二部影片被下载

gotoNetPage
类型:命令
句法:gotoNetPage("http://www.hoperich.com";,"_blank")/
描述:在Shockwave里,它把一个新URL调入当前浏览器窗口或另一个窗口/帧。也可以用第二个参数作为浏览器的目标。在放映机里,它运行用户的浏览器并调入U RL

mediaReady
类型:属性
句法:if sprite(7).mediaReady then...
描述:对于链接的演员、演员表库或角色来说,如果演员已从因特网上下载,则返回True

netAbort
类型:命令
句法:netAbort(gNetID)
描述:取消一次网络*作

netDone
类型:函数
句法:if netDone(gNetID) then....
描述:如果网络*作已完成,则返回True

netError
类型:函数
句法:if netError(gNetID)<>0 then...
描述:如果没有错误返回0,如果有错误,则返回一个错误代码

netLastModDate
类型:函数
句法:modDate=netLastModDate(gNetID)
描述:在netDone返回True之后,该函数返回那个项目的修改日期

netMIME
类型:函数
句法:mime=netMIME(gNewID)
描述:在netDone返回True之后,该函数返回那个项目的MIME类型(文件类型)

netPresent
类型:属性
句法:if the netPresent then...
描述:如果一个放映机里有Xtra,则返回True,但是不告诉我们是否有网络连接

netTextResult
类型:函数
句法:myText=netTextResult(gNetID)
描述:在netDone返回True之后,该函数返回那个项目的文本

netThrottleTicks
类型:属性
句法:the netThrottleTicks=30
描述:给网络*作分配时间的频繁程度。缺省值是15.该值越高,表示处理网络命令的时间越少。

postNetText
类型:命令
句法:postNetText(myURL,mylist)
描述:该命令使用Internet Post协议与服务器联络,并向它发送信息。它接受URL和特殊格式的列表。

proxyServer
类型:命令
句法:proxyServeer serverType,ipaddress,portNum
描述:为一个将要用于放映机的代理服务器设置一个值

streamStatus
类型:事件处理程序
句法:on streamStatus URL,state,bytesSoFar,bytesTotal,error
描述:当某个演员被流式传输时定期地被调用,将发送流式传输的信息

tellStreamStatus
类型:函数
句法:tellStreamStatus(True)
描述:如果设置为True,streamStatus消息将被送给on StreamStatus处理程序