打印

Director常用Lingo

利用控制Director电影的重要方面就是利用控制各个方面的属性,下面列出常用的精灵属性、字段属性、造型成员属性,以及其他的一些常用的命令和句柄。


--------------------------------------------------------------------------------


1.常用精灵属性
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 ofsprite 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 scriptNum 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 ofsprite 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

本帖最近评分记录
2.常用字段属性

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,,,5
scrollByPage
语)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


3.常用遣型成员属性

backColor
语法: set the backCo1or of member whichCastmenlber to co1orNumber
用途: 此属性决定了造型成员的背景颜色。
举例: set the backCo1or of member 1 to 250

depth
语法:the depth of member whichCastmember
用途: 此属性返回造型成员的颜色深度,但是不能对其进行设置。
举例: put the depth of member”Shrine”

duration
语法:the duration of member whichCastmember
用途:此属性决定了造型成员的持续时间。
举例: set the duration of memberber"Fog” = 1O00

fileName
语法:the fileName of member whichCastmember
用途:此属性决定了外部链接造型成员所对应的外部文件名称。
举例: set the fileNanie of member 40="aaa"

foreColor
语法:the foreColor of member castName to colorfNumber
用途:此属性决定了造型成员的前景色。
举例: set the foreColor of member I to 250

height
语法: the height of member whichCastmember
用途:此属性返回位图和形状造型成员的高度,但是不能对其进行设置。
举例: put the height of member"Headline"

media
语法:the media  of member whichCastmember
用途:此属性返回描述造型成员的数据,可以通过复制这个属性来复制造型成员中的内容。
举例: set the  media of member“Down”to the media of member”Rise“

modified
语法: the modified of member whichCastmember
用途:此属性返回这个造型成员从电影文件中被读入以来是否被修改过的记录值。
举例: put the modified of member"memberl"

name
语法:the name of member whichCastmember
用途:此属性决定了造型成员的名称。
举例: set the name of men1ber l to"Background"
set the name of member“On” to “Off“

nummber
语法: the nummber of member whichCastmember
用途: 此属性决定了造型成员的编号。
举例: put the number of member”power Switch”

paletteRef
语法: the paletteRef of member whichCastMember
用途: 此属性决定了造型成员所映射到的调色板。对应的值为#systemMac,#rainbow等等。
举例: set the paletteRef of member”Shell”to #systemWin

rect
语法: the rect of member whichCastmember
用途: 此属性决定了造型成员的左上角和右下角的坐标。
举例: set the rect of member l= rect(l00, 150, 300, 400)

regPoint
语法: the regPoint of member whichCastMember
用途: 此属性决定了造型成员注册点的坐标。
举例: set the regPoint of member”Desk”=poini( 100, 200)

scriptsEnabted
语法: the scriptsEnabled of member whichCastmember
用途: 此属性决定了链接电影造型成员中的脚本是否有效。
举例: set the scriptsEnabled of member”puzzle” = TRUE

scriptText
语法: the scriptText of member whichCastmenlber
用途: 此属性决定了脚本造型成员的内容。
举例: set the scriptText of member 30 = the text of member l0

scriptType
语法: ihe scriptType of member whichScript
用途: 此属性决定了脚本造型成员的类型,其值为#MOVIE, #SCORE和#PARENT。
举例: set the scriptType of member”Main” to #movie

size
语法: the size of member“,whichCastMember
用途: 此属性返回造型成员所占空间的大小。
举例: put the size of menlber”pic”into member”size”

type
语法: the type of member whichCastmember
用途: 此属性决定了造型成员的种类,有以下几种:
#bitmap, #palette, #button, #picture, #fIlmLoop, #sound, #digitalVideo等等。
举例: if the type of member” News”=#field then fieldFormat
width
语法: the width of member whichCastMember
用途: 此属性返回了造型成员的宽度,但是不能进行设置。
举例: put the width of member 50

4.常用声音Lingo
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

TOP

还在为头像烦恼?还在为不能关注好友动态烦忧?快来蓝色理想家园吧!
5. MIAW常用Lingo
close whdow
语法: close whdow whdowIdentfier
用途: 此命令用来关闭指定的窗口。
举例: c1ose window“Sources”

movcToBack
语法: movcToBack window”whichWindow”
用途: 此命令将指定的窗口移动到所有别的窗口的后面。
举例: moveToBack window"Demo Window"

forget window
语法: forget window whichWindow
用途: 此命令用来清除窗口。
举例: forget window” Sources”

moveToFront
语法: moveToFront window”whichWindow”
用途: 此命令将指定窗口移动到其他所有窗口的前面。
举例: moveToFront window”Demo Window”

open window
语法: opon window”whichWindow”
用途: 此命令用来打开指定的窗口。
举例: open window”DemO Window”

activeWindow
语法: the activeWindow
用途: 此属性用来指示当前的激活窗日。
举例: set the tit1e of the activeWindow to“Ative”

drawRect
语法: the drawRect of window windowName
用途: 此属性决定了窗口中的电影在窗口中显示时的左上角和右下角的坐标值。
举例: put the drawRect of window“Ative’
              --rect(20,20,200,200)

fi1eName
语法: the fi1eName of window whichwindow
用途: 此属性用来决定窗口所指定的电影。
举例: set the fi1eName of window“Ative”="Tanel”

frontWindow
语法: tbe frontWindow
用途: 此属性指示了最前面的窗日名称。
举例: if the frontWindow=the stage then moveToFront window”Try”

modal
语法: the moda1 of window"window"
用途: 此属性决定了窗口是否可以响应窗口外发生的事件。如果为TRUE,这个窗口就不能响应窗口外发生的                             事 件,如果为FALSE,就可以响应窗口外的事件。
举例: set the moda1 of window"Tool”to FALSE

rect
语法: the rect of wtndow whichWindow
用途: 此属性决定了窗口的左上角和右下角的坐标。
举例: put the rect ofwindow”panel”

name
语法: the  name of Window”whichWindow”
用途: 此属性决定了指定窗口的名称。
举例: set the name of window”panel”to“Today”

tit1eVisib1e
语法: the tit1eVisib1e of window whichWindow
用途: 此属性决定了窗口标题的可见性。
举例: set the tit1eVisible of window”panel”to TRUE

tit1e
语法: the tit1e of window whichWindow
用途: 此属性决定了窗口标题的内容。
举例: set the title ofwindow”panel”to”Action View”

windowList
语法: the wtndowList
用途: 此属性决定了一个电影中所有已经定义而且没有被清除的窗口的名称列表。
举例: set the windowList=[]

windowType
语法: the windowType of window whichWindow
用途: 此属性决定了窗口的风格。
举例: set the windowType ofwindow” panel” to 8

activatewmdow
语法: on activatewmdow
用途: 此句柄在窗口被激活的时候被执行。
举例: on activateWindow
                   puppetSound 1, "Hurray”
              end

c1oseWindow
语法: on c1oseWindow
用途: 此句柄在窗口被关闭的时候被执行。
举例: on c1oseWindow
                     forget the activeWindow
              end

deactivateWindow
语法: on deactivateWindow
用途: 此句柄在窗口不再是活动窗日的时候被执行。
举例: on deactivateWindow
                   puppetSound 2.”Bye”
              end

moveWindow
语法: on moveWindow
用途: 此句柄在窗口被移动时被执行。
举例: on moveWindow
                     puppetSound 2.“Moving”
              end

openWindow
语法: on openWindow
用途: 此句柄在窗口被打开时被执行。
举例: on openWindow
                    puppotSound2,”Opening”
              end

resizewindow
语法: on resizewindow
用途: 此句柄在窗口大小被改变时被执行。
举例: on resizeWindow
                set the locH of  sprite 3 to 1O0
              end

zoomWindow
语法: on zoomWindow
用途: 此句柄在用户单击了窗口上的最大或最小按钮时被执行。
举例: on zoomWindow
                    set the locH of sprite 3 to 1O0
              end

TOP