#12000/11/23 13:17:36
Lingo的指令 (S~Z)
saveMovie
语法:
saveMovie {pathname : filename}
将当前的电影存盘,在pathname : filename中写的是文件与路径的名称。
scoreColor
语法:
the scoreColor of sprite whichSprite
查询分镜颜色的号码。可以选取的颜色有六种,数字代号为0到5,如图51所示。
图51 查询分镜颜色的号码
script of menuItem
语法:
the script of menuItem of menu whichMenu
指定某一个菜单whichMenu中的指令menuItem所应该执行的程序,可以自行设计一
个Handler给这个指令。如:
set the script of "runAndy" of menu "andyMenu" to "andyHandler"
表示andyMenu菜单中的指令runAndy的程序要重新设定为一个新的Handler,这个
Handler为andyHandler。
scriptNum of sprite
语法:
scriptNum of sprite whichSprite
查询某一个特定的sprite所使用的程序编号,事实上这个编号是卡司成员上的位置代
号Cast member ID。
scriptText of cast
语法:
the scriptText of cast whichCastmember
查询或设定某一个程序中的内容,这个新的内容可以由一个文字的卡司成员代表,如
下列所示:
set the scriptText of cast 1 to the text of cast 2
表示将第一个卡司成员的程序script,设定为第二个卡司成员中的文字,所以第一个
卡司成员应为图形、影片、动画等对象,而第二个卡司成员应为文本对象。
searchCurrentFolder
语法:
the searchCurrentFolder
若将the searchCurrentFolder设定为真,表示当寻找与指令有关的文件时,会从电影所
在的目录先找起。
searchPath
语法:
the searchPath
若在电影所在的目录找不到所要找的文件,则系统会从the searchpath中所设定的目录
找起。
selection
语法:
the selection
找出一个文本对象中被选取的字串,the selection中所存放的就是这个字串。
selEnd
语法:
the selEnd
由指令来设定选取文本的结束位置。
selStart
语法:
the selStart
由指令来设定选取文本的开始位置。
set ... to and set ... =
语法:
set the property to expression
set the property = expression
set variable to expression
set variable = expression
set的功能主要在于设定某一个变量的值,它的语法有上列四种。
setaProp
语法:
setaProp list, property, newvalue
将某一个阵列中的内容property 改变成为新的内容newvalue。如:
set andy = [# AD: 100]
表示andy为一个阵列,它的内容有#AD与其值100。
setaProp andy, #BT, 1000
表示将andy的内容改变为[#BT, 1000]。
setAt
语法:
setAt list, orderNumber, value
将某一个阵列list中某一个位置orderNumber的值,改变为新的值value,但这个指
令只适用于线性的阵列linear list。
2set andy = [2, 5, 8, 12, 45 ]
setAt andy, 4, 88
则andy的值变成为[2, 5, 8, 88, 45 ]。
setProp
语法:
setProp list, property, newvalue
将指定阵列中符号property的值改变成为新的值。
set andy = [#AD : 100]
setProp andy, #AD, 1000
表示将andy的内容改变为[#AD, 1000]。
shiftDown
语法:
the shiftDown
测试shift键是否被按下。若被按下则the shiftDown的值为真,未被按下则the
shiftDown的值为假。
showGlobals
语法:
showGlobals
显示所有Global变量的值,这个指令可以帮助检测程序是否有错。
showLocals
语法:
showLocals
显示所有Local变量的值。
showXlib
语法:
showXlib {Xlibfilename}
显示可以使用的XObject。在windows的环境中,可以将它看作是一个.dll的函数
库。如图52所示。
图52 显示可使用的XObject
shutDown
语法:
shutDown
这个shutDown的指令在windows中含有两个动作,即先离开电影回到windows之下,
然后再离开windows。
sin
语法:
sin (angle)
找出一个角度(angle)的sin。
size of cast
语法:
the size of cast castName
查询某个卡司成员的大小,也就是占磁盘空间的大小,计数单位为byte,请参考图
53。
图53 查询卡司成员的大小
sort
语法:
sort list
将某一个阵列重新依序排列。
set andy = [#A: 100, #C: 10, #B: 1]
则sort andy的结果为[#A: 100, #B: 1, #C: 10]
当然也可以将线性阵列重新排列,请参考图54。
图54 重新排列线性阵列
soundBusy
语法:
soundBusy (whichChannel)
查询某一个sound channel中是否有音乐在播放,若有的话则返回真值。
sound close
语法:
sound close soundChannel
将某一个sound channel中的音乐停止播放。
soundEnabled
语法:
the soundEnabled
将某一个sound channel中的音乐启动或是关闭,若soundEnabled值设定为真,表
示可以听到正常的音乐,若soundEnabled值设定为假,则表示无法听到音乐的内容。
sound fadeIn
语法:
sound fadeIn whichChannel {, tick}
指定声音淡入的长度,tick为计数单位,每一单位表示1/60秒。
sound fadeIn, 1, 60
表示在第一个sound channel中的声音,以一秒钟的时间淡入。
sound fadeOut
语法:
sound fadeOut whichChannel {, tick}
指定声音淡出的长度,tick为计数单位,每一单位表示1/60秒,它的功能与淡入
类似。
soundLevel
语法:
the soundLevel
设定声音的大小,声音的大小可以由数值来控制,数值最小为0,最大为7。
sound of cast
语法:
the sound of cast castMember to onOrOff
将某一个数字影片的卡司成员内部的声音设定为开或关,若将本指令的值设定为
真,则影片的声音会随影片播映开启,若将本指令的值设定为假,则影片的声音会
关闭。
sound playFile
语法:
sound playFile whichChannel, whichFile
指定某一个Sound channel中所要播放的声音文件。这并不是一个声音的卡司成员,而
是一个外部的文件,文件的格式有两种:一是*.wav,一是*.aif。例如:
sound playFile 1, "andy.wav"
表示将在Sound channel 1中播放名为andy的WAVE文件。
sound stop
语法:
sound stop whichChannel
将指定某一个Sound channel中的声音停止播放。
the sourceRect of window
语法:
the sourceRect of window whichWindow
当使用window指令产生一个新的视窗后,可以利用这个指令来查询这个视窗的坐标。
如:
put the sourceRect of window "andy"
表示将andy这个视窗的坐标值显示在message视窗之中。
sprite
语法:
the property of sprite whichSprite
查询或设定某一个特定分镜的内容。如:
set the puppet of sprite 1 to TRUE
表示将第一个分镜设定为Puppet。
put the locH of sprite 1 into andy
表示将第一个分镜的水平位置存放到变量andy之中。
Sprite ... intersects
语法:
sprite sprite 1 intersects sprite 2
查询任意两个分镜是否有重叠的现象,若重叠的话,则指令的值为真。如:
if sprite 1 intersects sprite 2 the alert "Watch out!"
表示当第一个分镜中的图形与第二个分镜中的图形重叠时,就显示警告的信息Watch
out! 告知用户要小心。
sprite within
语法:
sprite sprite 1 winthin sprite 2
查询某两个分镜是否有内含的现象,若sprite 1内含在sprite 2之中的话,则指令的值为
真。如:
if sprite 1 winthin sprite 2 the alert "You got it!"
表示当第一个分镜中的图形跑到第二个分镜中的图形之中时,就会显示信息You got
it ! 告知用户已经完成工作了。
spriteBox
语法:
spriteBox whichSprite, left, top, tight, bottom
将某一个分镜的图形范围限制在上、下、左、右的四个点之内。
sqrt
语法:
the sqrt (number)
计算某一数值的平方根。
stage
语法:
the stage
本指令表示与舞台相关的指令。如
put the rect of the stage
表示显示舞台的位置与大小。
stageBottom
语法:
the stageBottom
舞台底部边界与主画面上方的距离。
stageColor
语法:
the stageColor
显示或设定舞台的颜色。若视窗为256色,则the stageColor的值介于0到255之间。
stageLeft
语法:
the stageLeft
舞台左方边界与主画面左方的距离。
stageRight
语法:
the stageRight
舞台右方边界与主画面左方的距离。
stageTop
语法:
stageTop
舞台上方边界与主画面上方的距离。
starts
语法:
string 1 starts string 2
若字串一从第二个字串开始,则指令的值为真。
put "An-Te Tseng" into Var
put "An" into Var 1
put "Te" into Var 2
put Var starts Var 1 into AD
则AD变量的值为真。
put Var starts Var 2 into BD
则BD变量的值为假。
startTime of sprite
语法:
the startTime of sprite spriteNumber
指定某一个影片开始播映的时间。如:
set the startTime of sprite 1 to 120
表示让第一个分镜中的影片从第二秒开始播映。
startTimer
语法:
startTimer
设定Timer值为0,而且让Timer开始计时。
stillDown
语法:
the stillDown
在用户按下鼠标键之后,若用户尚未放开鼠标键,则the stillDown的值为真。
stopTime of sprite
语法:
the stopTime of sprite whichsprite
指定某一个影片停止播映的时间。如:
set the startTime of sprite 1 to 240
表示让第一个分镜中的影片只播映四秒钟即止。
stretch of sprite
语法:
the stretch of sprite whichSprite
指定某一个卡司成员是否可以被挤压到特定的矩形中。这个挤压的框可以利用
the spriteBox来设计,若将the stretch of sprite的值设定为真,则这个卡司成员可以被
挤压到指定的矩形中。
string
语法:
string (expression)
将某一个数值转换为字串。
stringP
语法:
stringP (expression)
查询某一个变量或表达式的值是否为一个字串,若是则指令的值为真。
symbolP
语法:
symbolP (expression)
查询某一个表达式的值是否为一个符号,若是则指令的值为真。
TAB
语法:
TAB
代表用户所按的Tab键。
tan
语法:
tan (angle)
计算某一个角度的tangent值。
tell
语法:
tell object
statement (s)
end tell
当电影正在播映时,如何传送信息呢?tell指令可以实现这个功能,例如:
tell window "andy" to play done
表示告诉视窗andy中的电影结束play播映的指令动作。
text of cast
语法:
the text of cast whichCastmember
查询或设定某一个卡司成员的文字内容。如:
set the text of cast 1 to "An-Te Tseng"
表示将第一个卡司成员内的文字设定为An-Te Tseng。
textAlign of field
语法:
the textAlign of field whichField
查询或设定某一个文本对象的对齐方式,选项有三种:Right、Left、Center。
set textAlign of field "andy" to "center"
表示将名为andy的文本卡司成员设定为居中对齐。
textFont of field
语法:
the textFont of field whichField
查询或设定某一个文本对象的字体。
textHeight of field
语法:
the textHeight of field whichField
查询或设定某一个文本对象的高度。
textSize of field
语法:
the textSize of field whichField
查询或设定某一个文本对象可用的存储器空间大小。
textStyle of field
语法:
the textStyle of field whichField
查询或设定某一个文本对象的样式,如粗体bold、斜体Italic、加底线Underline、
阴影Shadow等等。
the
语法:
the property
一般来说,在Lingo之中the值必须与指定的值合用,这个值可以为一个变量或者为
表达式,the property表示这个表达式的值。
ticks
语法:
the ticks
返回当前时间的值,以Tick为单位计算。若要计算秒数,则使用the ticks/60,也就
是将它除以60即可;若要计算分数,可以将它再除一次60即可。
time
语法:
the short time
the long time
the abbreviated time
the abbrev time
the abbr time
时间的指令,请参考下列内容:
范例:
put the abbr time
"4: 24 AM"
这个指令等于put the abbrev time,也等于put the abbreviated time,也等于put the
time,也等于put the shor time。
put the long time
"4: 24: 37 AM"
timeoutKeyDown
语法:
the timeoutKeyDown
这与the timeoutMouse非常类似,它也是一个逻辑变量,当the timeoutKeyDown设
定为真时,如果用户按了任何的键盘键,the timeoutLapsed值会重新计算,也就是重
新计时。如果将the timeoutKeyDown设定为假时,不管用户在何处何时按键,都不会
重新计时。
timeoutLapsed
语法:
the timeoutLapsed
如果设计了定时的长度,也就是设计了the timeoutLength的时间,the timeoutLapsed
会随时记录时间的倒数,当the timeoutLapsed达到the timeoutLength时,就会启动the
timeoutScript,所以可以在the timeoutScript中放置该做的动作。
timeoutLength
语法:
the timeoutLength
设定计时长度,以Tick为单位计算时间,60 Ticks等于一秒钟。如果定时的长度为
三秒钟时,就可以设计the timeoutLength为180。
范例:
set the timeoutLength to 180
timeoutMouse
语法:
the timeoutMouse
这是一个逻辑变量,当the timeoutMouse设定为真时,如果用户按了鼠标键,the
timeoutLapsed值会重新计算,也就是重新计时。换句话说,此时鼠标键的事件可以重
新计时。如果将the timeoutMouse设定为假时,不管用户在何处何时按了鼠标键,都
不会重新计时。
timeoutPlay
语法:
the timeoutPlay
这个指令可以决定是否重设the timeoutLapsed,当the timeoutPlay设定为真时,the
timeoutLapsed值会重新计算。the timeoutPlay的初始设定为假,所以要设定它为真时,
必须自行设定。
timeoutScript
语法:
the timeoutScript
设计计时到时所该做的动作,可以指定一个Handler给这个指令,告知系统当计时到
时,就该去执行这个Handler的内容。
范例:
设定计时到的时候所该执行的内容为ShowAndy:
set the timeoutScript to "ShowAndy"
timer
语法:
the timer
这个指令中所存放的是一个时间值,它与Timeout没有任何关系,它只是计算时间
的长度。何时开始计算呢?从StartTimer设定后开始,所以可以利用这两个指令来显示
用户上机的时间。当然它的值是以Tick为单位,将它除以60之后,就变成了秒数。
title of window
语法:
the title of window whichWindow
查询或设定某一个视窗的名称。
titleVisible of window
语法:
the titleVisible of window whichWindow
设定视窗的标题行显示与否。若指令的值为真,则此视窗的标题行会显示;若指令
的值为假,则此视窗的标题行不会显示。
top of sprite
语法:
the top of sprite whichSprite
某一个分镜上方的垂直坐标。
trace
语法:
the trace = truOrFalse
设定系统是否追踪电影执行的状态,若the trace为真,则电影播映时的状态会被系统
追踪记录。
traceLoad
语法:
the traceLoad
当设定追踪电影的状态时,the traceLoad可以设定显示的信息,这个信息表示装入某
一个卡司成员时的信息,the traceLoad的值有三种设定,如表19所示。
表19
数值 意义
0 不显示任何信息
1 显示卡司成员的名称
2 显示卡司成员的名称、当前的镜头号码、电影名称、搜寻路径
traceLogFile
语法:
the traceLogFile
将Message视窗中的信息写成为一个文件,如:
set the traceLogFile to "andy"
表示将Message视窗中的信息写成名为andy的文件。
set the traceLogFile to ""
表示不将Message视窗中的信息写成文件。
trails of sprite
语法:
the trails of sprite whichSprite
将某一个分镜中的图形残留效果设定为真或假,若设定为真时,这个分镜中的图形
在移动时会有残留效果产生。
type of sprite
语法:
the type of sprite whichSprite
分镜图形的属性。属性以号码代表所有的类型,各类型的意义如表20表示:
表20
号码 意义 号码 意义
0 将分镜puppetSrite的设计取消 6 从右上往左下的线段
1 点矩阵图形 7 文字
2 矩形 8 按钮
3 圆边矩形 9 检查框
4 椭圆图形 10 选项按钮
5 从左上往右下的线段 16 未定
union rect
语法:
union (rect 1, rect 2)
返回包含两个矩形的最小矩形。如:
put union (rect (10, 10, 50, 50), rect(5, 5, 100, 100))
结果值为rect(5, 5, 100, 100)。
unload
语法:
unLoad
unLoad theFrameNum
unLoad fromFrameNum, toFrameNum
将某部分卡司成员从存储器中移出。若单使用指令unLoad则表示将全部的卡司成
员从存储器中移出,若语法为第二种:
unLoad 100
表示将第100个镜头上的卡司成员从存储器中移出。
unLoad 100, 110
表示将第100个镜头到第110个镜头上的卡司成员从存储器中移出。
unloadCast
语法:
unloadCast
unloadCast castName
unloadCast fromCastName, toCastName
将某部分卡司成员从存储器中移出。若单使用指令unloadCast则表示将全部的卡司
成员从存储器中移出,若语法为第二种:
unLoadCast 100
表示将第100位置上的卡司成员从存储器中移出。
unLoadCast 100, 110
表示将第100个位置到第110个位置上的卡司成员从存储器中移出。
updateMovieEnabled
语法:
the updateMovieEnabled
表示当电影播映时,在调用另一个电影之前,自动将当前的电影储存。
updateStage
语法:
updateStage
表示将舞台上的图形更新,当使用puppetSprite来改变图形的属性时,必须使用这个
指令,才会看到画面上新的图形。
value
语法:
value (string)
计算一个字串的数值。
version
语法:
global version
当前软件的版本号。
video fo cast
语法:
the video of castName
设定某一个影片的卡司成员是否显示。若将指令的值设定为假,则此影片的画面会
消失。
visible of sprite
语法:
the visible of sprite whichSprite
设定某一个分镜的图形是否显示,若将指令的值设定为假,则此图形会从画面上消失。
visible of window
语法:
the visible of window whichWindow
设定某一个视窗是否显示,若将指令的值设定为假,则此视窗会从画面上消失。
voidP
语法:
voidP (variableName)
查询某一个变量是否已赋了初始值,若返回的值为真,表示此变量尚未赋初始值。
volume of sound
语法:
the volume of sound whichChannel
设定某一个sound channel的音量大小。音量从最小为0到最大255。
volume of sprite
语法:
the volume of sprite spriteNum
调整某一个分镜上数字影片的音量大小。音量大小从-256到256。如:
set the volume of sprite 1 to 256
表示将第一个分镜中影片的音量调整到最大。
width of cast
语法:
the width of cast whichCastmember
查询某一个点矩阵图形或向量图形卡司成员的宽度。
width of sprite
语法:
the width of sprite whichSprite
查询某一个分镜的宽度。
window
语法:
window whichWindow
在window之后的字串表示这个视窗的名称。如:
open window "andy"
表示打开一个名为andy的视窗。
windowList
语法:
the windowLIst
查询当前所有已使用到的影片视窗。如果设定一个空白的阵列,就表示将指令的
值重新设定,如:
set the windowList = [ ]
windowType
语法:
the windowType of window
设定视窗的属性,其属性用一个数值代表,各数值有一个独自的意义,请参考表21。
表21
数值 意义
0 标准的视窗
1 警告信息的对话视窗
2 含有简单边线的视窗
3 含有边线与阴影的视窗
4 不含有最大化与最小化按钮的视窗
8 可以改变大小的视窗
12 可以改变大小的视窗,但不含有最大化与最小化按钮
16 含有曲线边界的视窗
word of
语法:
word whichWord of chunkExpression
word firstWord to lastWord of chunkExpression
指定的字串的动作,动作描述在chunkExpression之中,而字串则放置在whichWord
之中。如果您想用两个字来定义这个字串的起点与终点,请使用第二种写法。
put word "An-Te Tseng" into Andy
表示将字串An-Te Tseng 存放到变量Andy之中。
put word 2 of "An-Te Tseng" into Andy
表示将字串An-Te Tseng的第二个字,存放到变量Andy之中,所以Andy之中的值
为Tseng。
zoomBox
语法:
zoomBox startSprite, endSprite, [, delayTicks]
利用两个分镜将部分画面放大。startSprite表示开始的分镜,endSprite表示结束的分
镜,delayTicks表示放大的时间长度。