#12001/2/18 0:53:59
Syntax sprite(whichVectorOrFlashSprite).viewScale
the viewScale of sprite whichVectorOrFlashSprite
member(whichVectorOrFlashMember).viewScale
the viewScale of member whichVectorOrFlashMember
Description 成员属性及精灵属性;可用来缩放整个FLASH影片及在矩形边框范围内缩放矢量图形精灵。你可以用浮点数来指定缩放百分比,默认值是100。
精灵的矩形本身并没有缩放;只是在矩形看上去被缩放了。设置viewScale值就象为照相机选择镜片。当viewScale值缩小时,在影片中的精灵显示放大,反之亦然。例如,把viewScale的值设为200% 意味着精灵区域将以原来两倍显示,而在精灵中的成员将以原来大小的一半显示。
viewScale 和scale的一个重要区别是-- viewScale总是以精灵边框的中心点为中点缩放,而scale以FLASH影片的原始中心点缩放。
此属性可以被测试和设置.
Note: 如果scaleMode被设为#autoSize时,这个属性必须被设为默认值,否则精灵将不被正确显示。
Example 下例将FLASH影片以原大2倍显示:
on beginSprite me
sprite(spriteNum of me).viewScale = 200
end
See also scaleMode, viewV, viewPoint, viewH
---------------------------------------------------------------------------------------------------------------
Syntax sprite(whichVectorOrFlashSprite).viewV
the viewV of sprite whichVectorOrFlashSprite
member(whichVectorOrFlashMember).viewV
the viewV of member whichVectorOrFlashMember
Description 成员及精灵属性;控制FLASH影片的垂直坐标及形状演员的观察点,指定像素单位。值可用浮点数表示。默认值是0。
FLASH影片的观察点是依它的原始坐标点设置的。
把viewV 设为正值,将会使在精灵内的影片向上移动,若设为负值,则会使精灵内的 影片向下移动。因此,改变viewV属性会对影片的裁减产生影响甚至使电影完全移出 视图。
此属性可以被测试和设置.
Note: 如果scaleMode被设为#autoSize时,这个属性必须被设为默认值,否则精灵将不被正确显示。
Example 下例将精灵作为参数,并在精灵的矩形边界内将FLASH影片精灵视图从顶端移至底部。
on panDown whichSprite
repeat with i = 120 down to -120
sprite(whichSprite).viewV = i
updateStage
end repeat
end
See also scaleMode, viewV, viewPoint, viewH
------------------------------------------------------------------------------------------
Syntax sprite(whichSprite).visible
the visible of sprite whichSprite
Description 精灵属性;决定指定的精灵是(TRUE)否(FALSE)可见。此属性的设置将影响到此精灵所在通道内的其它所有精灵的可见度。
Note: 把某个精灵的属性设为visible,将会使此精灵不可见,并且使附在此精灵上的鼠标事件失效。
此属性可以被测试和设置。 如果将此属性设为FALSE,那当此精灵结束时,它不会自动变为TRUE,意味着在此精灵通道的其他精灵将不可见。为了使此通道的其它精灵可见,你必须再将此通道内的精灵的visible属性设为TRUE。
Example 下例使通道8中的精灵可见:
sprite(8).visible = TRUE
-----------------------------------------------------------------------------------------------------------
Syntax window whichWindow.visible
the visible of window whichWindow
Description 窗口属性;决定被指定的窗口的可见性是可见(TRUE)或不可见(FALSE)。
此属性可以被测试和设置。
Example 下例使"Control Panel"窗口可见。
window("Control Panel").visible = TRUE
------------------------------------------------------------------------------------------------------
Syntax VOID
Description 常量;代表VOID值(或者说值为空)
Example 下例检验变量currentVariable的值是否为VOID:
if currentVariable = VOID then
put "This variable has no value"
end if
See also voidP()
-----------------------------------------------------------------------------------------------------
Syntax voidP(variableName)
Description 函数;判断所指定的变量是否被赋值。如果这个变量没有值或者值为VOID,那此函 数返回TRUE。反之,返回FALSE。
Example 下例检验变量answer是否有一个初始值:
put voidP(answer)
See also ilk(),VOID
-------------------------------------------------------------------------------------------------------
Syntax member(whichCastMember).volume
the volume of member whichCastMember
Description Shockwave Audio (SWA) 演员属性;确定被指定的SWA流成员的音量。取值范围从0 到255。
此属性可以被测试和设置。
Example 下例把SWA流演员的音量设到最高值(255)的一半:
member("SWAfile").volume = 128
-----------------------------------------------------------------------------------------------------
Syntax the volume of sound channelNum
Description 声音通道属性;确定指定声音通道的音量。声音通道用1,2,3,……来计算(表示)。其中通道1和2 在Score中显示。
音量值属性的范围从0(静音)到255(最大音量)。255代表把声音开到最大,正如 用soundLevel属性控制一样。这个属性允许设置几个单独声音通道的音量而不影响 到其他的声音通道。
把音量值设得越低,你就可能听到更多的静音或噪音。用soundLevel不会导致噪 音,但是它所能控制的属性也少。
此属性不支持点语法。正确的语法参考这里。
在DIRECTOR程序目录中的Learning\Lingo Examples文件夹中的Sound Control movie中有关于音量(volume)属性在整个电影中应用的范例。
Example 下例把声音通道2的音量设为130,它在sound level属性中是个中间值:
sound(2).volume = 130
See also fadeIn(), fadeOut(),soundEnabled, soundLevel, fadeTo(), pan (sound property)
---------------------------------------------------------------------------------------------------------
Syntax sprite(whichSprite).volume
the volume of sprite whichSprite
Description 精灵属性;通过数码电影演员的演员号或名称来控制该演员的音量。取值范围从0 到 256。0代表静音。当音量超过256时会导致声音较大失真。
Example 下例将正在通道7中播放的QUICKTIME电影的音量设到256,这是音量的最大值:
sprite(7).volume = 256
See also soundLevel
--------------------------------------------------------------------------------------------------------------
Syntax sprite(whichQTVRSprite).warpMode
warpMode of sprite whichQTVRSprite
Description QuickTime VR精灵属性;指定它在全景图中的扭曲特性。
可能的值是#full, #partial, 和 #none。
此属性可以被测试和设置。 当测试时,如果静态属性值和动态属性值不同,那返回 的属性值将是该QuickTime VR电影当前状态的属性值。当设置时,所设置的值将同 时赋予它的静态模式和动态模式。
Example 下例将精灵1的warpMode设为#full:
sprite(1).warpMode = #full
--------------------------------------------------------------------------------------------------------------
Syntax member(whichCastMember).width
the width of member whichCastMember
imageObject.width
sprite(whichSprite).width
the width of sprite whichSprite
Description 演员,图象对象和精灵的属性;用象素指定矢量图形,Flash, animated GIF, 位 图和形状演员的宽度,对Field及按钮演员不起作用。
对于演员和图片对象, 此属性可以被测试; 对于精灵, 此属性可以被测试和设置。
在位图精灵上设置此属性将会把该精灵的伸展属性自动设为TRUE。
Example 下例把演员50的宽度值(width)赋予它的高度值:
height = member(50).width
Example 下例将精灵10的宽度值(width)设为26像素(pixels):
sprite(10).width = 26
Example 下例将精灵 i+1 的宽度值赋予变量 howWide:
howWide = sprite(i + 1).width
See also height
-----------------------------------------------------------------------------------------------------------------
Syntax window whichWindow
Description 关键字;在DIRECTOR电影中引用指定窗口。
窗口在播放电影时常用来做浮动面板,单独的控制面板和特殊形状的窗口。用窗口 播放电影,你可以同时打开几个电影,并让他们产生交互。
Example 下例打开一个名叫Navigation的窗口:
open window "Navigation"
Example 下例把Navigation窗口移到最前面:
moveToFront window "Navigation"
or
window("Navigation").moveToFront()
See also close window, moveToBack, moveToFront, open window
-------------------------------------------------------------------------------------------------------
Syntax the windowList
Description 系统属性;显示所有已知名的电影窗口列表。
Example 下例在消息窗口中显示所有已知名的电影窗口列表:
put the windowList
Example 下例清除电影窗口列表:
the windowList = [ ]
See also windowPresent()
---------------------------------------------------------------------------------------------------------------
Syntax windowPresent(windowName)
Description 函数;判断某个指定对象是(TRUE)否(FALSE)以窗口中的电影方式在播放。如果某 个电影窗口被打开,windowPresent属性保留TRUE,直到那个窗口被从窗口列表属 性中删除。
windowName参数必须同它在windowList中显示的名称一致。
Example 下例用来测试myWindow对象是否以电影中的窗口形式(MIAW)被打开,并在消息窗口 中显示结果:
put windowPresent(myWindow)
See also the windowList
-----------------------------------------------------------------------------------------------------
Syntax window whichWindow.windowType
the windowType of window whichWindow
Description 窗口属性;指定特定窗口的显示模式,如下所示:
0、可移动,可缩放的没有最大、最小化按钮的窗口
1、警告框或对话框窗口
2、没有标题栏、不可移动的简单窗口
3、带阴影没有标题栏的窗口
4、可移动但不能缩放的窗口
5、可移动的对话框窗口
8、标准文件窗口
12、可缩放但不可最小化的窗口
16、曲线边框窗口
49、浮动面板,在编辑模式里(在Macintosh的放映机里49代表一个固定的窗口)
你可以在打开窗口前设置这些属性。数字6, 7, 9, 10, 11, 13, 14, 15, 和 17到48 对窗口类型不产生影响。
你可以在窗口打开后改变窗口的类型,但窗口的刷新可能会导致一些延迟。
如果不指定窗口的类型,默认值是0。
这些数字创建的窗口有相同的功能,除了外观不同外。其他值的窗口类型也可能存在,但要谨慎使用,因为有些窗口模式要重启动才可以退出。
Example 下例将名为“Control Panel ”窗口的显示模式设置为8:
window("Control Panel").windowType = 8
---------------------------------------------------------------------------------------------------------------
Syntax member(whichCastMember).word[whichWord]
textMemberExpression.word[whichWord]
chunkExpression.word[whichWord]
word whichWord of fieldOrStringVariable
fieldOrStringVariable. word[whichWord]
textMemberExpression.word[firstWord..lastWord]
member(whichCastMember).word[firstWord..lastWord]
word firstWord to lastWord of chunkExpression
chunkExpression.word[whichWord..lastWord]
Description 块表达式;在一个块表达式中指定一个单词或句子的范围。一个单词块代表任何被 空格符隔开的字符序列。(任何不可见的字符,如TAB符或回车符(RETURN),也被 认为是空格符。)
表达式中whichWord(哪个单词), firstWord(起始单词), 和lastWord(结束 单词)必须在块中被转化成整数值。
块表达式可以代表在任何字符源中的字符,单词,条目或行。字符源包括field和文 字演员及字符串变量。
在Director文件目录下的Learning\Lingo Examples文件夹中有相关例子可参考。
Example 下例将单词"elk"插入到字符串"fox dog cat"中的"fox"后:
animalList = "fox dog cat"
put "elk" before animalList.word[2]
结果是字符串"fox elk dog cat"
Example 下例告诉Director在消息窗口中显示字符串"fox elk dog cat"中第5个单词:
put "fox elk dog cat".word[5]
因为字符串中没有第5个单词,所以消息窗口将显示(""),代表空字符串。
See also char...of, line...of, item...of, count(),number (words)
-----------------------------------------------------------------------------------------------------------------
Syntax member(whichCastMember).wordWrap
the wordWrap of member whichCastMember
Description 演员属性;确定是(TRUE)否(FALSE)允许自动换行。
Example 下例将field演员Rokujo的自动换行属性关闭:
member("Rokujo").wordWrap = FALSE
--------------------------------------------------------------------------------------------------------------
Syntax xtra whichXtra
Description 函数;返回指定XTRA的的实例。
在Director文件目录下的Learning\Lingo Examples文件夹中有相关例子可参考。
Example 下例用new() 函数创建一个新的Multiuser Xtra的实例,并将它赋予变量tool:
tool = new(xtra "Multiuser")
See also new()
-----------------------------------------------------------------------------------------------------------------
Syntax the xtraList
Description 系统属性;把所有的可用的XTRAS和他们的版本显示在一个线性列表中。这在电影需 要某个特定版本的XTRAS的时候十分有用。
#name 说明指定XTRAS的所在的平台名称。很有可能列表中没有#name条目,例如当XTRAS只存在于一个平台时。
#version 当文件被从桌面上选取的时候,指定同一个版本号码会出现在对话框(WINDOW) 或是信息框(MACINTOSH)中. XTRA 不一定需要有版本号
当它在XtraList中可能有两种属性显示:
Example 下例在消息窗口中显示XTRA列表:
put the xtraList
Example 下例检验指定的XTRA的版本号:
-- This handler checks all the available Xtras to return the version of the requested Xtra
-- The XtraFileName may be only a partial match if desired
-- Use the full file name for more exact usage
-- The string returned is either the version property for the Xtra or an empty string
-- It may be empty if either the version property doesn't exist or the Xtra is not found in the available list
on GetXtraVersion XtraFileName
-- Get the entire list of Xtras and their information
listOfXtras = the xtraList
-- Initialize the local variable to contain the version
theVersion = ""
-- Iterate through all the Xtras listed
repeat with currentXtra in listOfXtras
-- If the current Xtra's name contains the Xtra passed in, then check for the version
if currentXtra.name contains XtraFileName then
-- First determine if the version property exists for that Xtra
versionFlag = getaProp(currentXtra, #version)
-- If the version property is not VOID, then set the local variable to
-- the string contained in that property value
if not voidP(versionFlag) then
theVersion = currentXtra.version
end if
end if
end repeat
-- Return the version information found or an empty string
return theVersion
end
See also movieXtraList, getaProp
------------------------------------------------------------------------------------------------------
xtras
See number of xtras
-----------------------------------------------------------------------------------------------------
Syntax zoomBox startSprite, endSprite {,delayTicks}
Description 命令;创建一个缩放效果,类似展开Macintosh中的FINDER窗口。缩放效果开始于startSprite的矩形边框,结束于endSprite的矩形边框。zoomBox命令依照下面的逻辑运行:
1 检查endSprite是否在当前帧,如果不在,
2 检查endSprite是否在下一帧。
注意:无论如何,zoomBox命令对于在同一通道上的endSprite和startSprite不起作用。
延迟的时间值根据你所设定的值,如果不设定,默认值是1。
Example 下例在精灵7和3之间创建一个ZOOM效果:
zoomBox 7, 3
--------------------------------------------------------------------------------------------------------
Syntax on zoomWindow
statement(s)
end
Description 系统消息事件,当窗口中的电影 (MIAW) 被调整大小时,执行包含着语句。
当用户点击最小化或最大化按钮(Windows) 或缩放按钮 (Macintosh)时此事件被触 发。还原时的尺寸由操作系统决定。
zoomWindow事件是用来放置那些在窗口尺寸改变时重新排列精灵的LINGO的好地方。
Example 下例当窗口尺寸改变时将centerPlace的坐标值赋予精灵3:
on zoomWindow
centerPlace = point(10, 10)
sprite(3).loc = centerPlace
end
See also drawRect, sourceRect, on resizeWindow