主题:  十七组下半部分

xuyi_5d

职务:普通成员
等级:2
金币:1.0
发贴:179
注册:2000/9/19 15:56:01
#12001/3/12 16:18:39
21.soundEnabled
语法    the soundEnabled
    描述    系统属性;确定声音是否正在播放
当你将这个属性设为FALSE,声音被关闭,但音量设置没有被改变。
属性可以被检验和设置。
例子    这个语句设置soundEnabled为当前设置的值取反;当声音为关闭时打开,当声音为打开时关闭
the soundEnabled = not(the soundEnabled)
参见    soundLevel, volume (sound channel), volume (sprite property)

22.sound fadeIn
语法    sound(whichChannel).fadeIn()
sound fadeIn whichChannel
sound(whichChannel).fadeIn(ticks)
sound fadeIn whichChannel, ticks

描述    命令;在一定时间的帧或tick时间内让指定声音通道的声音淡入。
当ticks被指定时, 淡入在这一段时间里均匀地的出现。
当ticks没有被指定时,缺省的ticks数基于帧速15*(60/(帧速))设置用于第一帧的淡入。
淡入在预定的速度上继续直到ticks数过去,或直到指定通道里的声音改变。
例子    这个语句让通道一里的声音在五秒里淡入。
sound(1).fadeIn(5 * 60)
参见    sound fadeOut, fadeTo()

23.sound fadeOut
语法    sound(whichChannel).fadeOut()
sound fadeOut whichChannel
sound(whichChannel).fadeOut(ticks)
sound fadeOut whichChannel, ticks

描述    命令;在一定时间的帧或tick时间内让指定声音通道的声音淡出。
当ticks被指定时, 淡入在这一段时间里均匀地的出现。
当ticks没有被指定时,缺省的ticks数基于帧速15*(60/(帧速))设置用于第一帧的淡入。
淡入在预定的速度上继续直到ticks数过去,或直到指定通道里的声音改变。
如果声音在延伸到最小音量前停止,它将保留停止时的音量大小,以至于后面回放的音量大小等于它。请确认声音淡出完全结束。
注意:你可以使用一个音量属性去建立一个自定义声音淡出去允许在通道的当前音量上进行更多的控制。
例子    这个语句让通道一里的声音在五秒里淡出。
sound(1).fadeOut(5 * 60)
参见    puppetSound, sound fadeIn, volume (sprite property), fadeTo()

soundKeepDevice
语法    the soundKeepDevice
描述    系统属性;只用于Windows,防止每次一个声音需要播放里对声音设备进行卸载和重载。缺省值为TRUE.
你可以在播放声音之前将这个属性设为FALSE以确保声音播放完成后电脑上的其它软件和程序可用声音设备。
如果声音播放在整个DIRECTOR程序中被频繁的使用,设置这个属性为FALSE会影响播放的效果。
属性可以被检验和设置。
例子    这个语句设置soundKeepDevice的属性为FALSE:
set the soundKeepDevice = FALSE

编辑历史:[这消息被xuyi编辑过(编辑时间2001-03-22 14:06:56)]


xuyi_5d

职务:普通成员
等级:2
金币:1.0
发贴:179
注册:2000/9/19 15:56:01
#22001/3/22 15:52:08
soundLevel
语法    the soundLevel
描述    系统属性;设置播放声音的计算机音箱的音量。可取的值为从0(没有声音)到7(最大,缺省值)。
在Windows中,系统声音设置外置音箱的音量控制。因此,当前的音量可以通过设置sound level改变。要避免改变sound level属性,除非你确认用户可以接受。最好单独设置通道的音量。
这些值符合Macintosh声音控制面板的设置。使用这个属性,LINGO能直接改变声音音量或当声音在指定级别时执行一些其它的动作。
属性可以被检验和设置。
要看soundLevel在完整影片中使用的实例,请打开Director应用程序所在文件夹下的Learning\Lingo Examples目录内的Director application文件夹。
例子    这个语句设变量oldSound等于当前音量。
oldSound = the soundLevel

例子    这个语句设音量为5:
the soundLevel = 5

参见    soundEnabled, volume (sound channel)

soundMixMedia
语法    the soundMixMedia
描述    当它为真时这个全局属性使flash演员的声音能与声音通道进行混合。当它设为FALSE时,这些声音必须被分次播放。在Director 7及以后的版本制作的影片中这个属性缺省为TRUE,以前版本为FALSE。
这个属性只在Windowsk有效。Director从Flash演员中接受声音并混合播放。有可能与Flash声音回放有轻微的差别出现。要听准确的Flash声音,设这个属性为FALSE。

sound playFile
语法    sound playFile whichChannel, whichFile
描述    命令;在由whichChannel指定的通道中播放由whichFile定位的AIFF, SWA, AU, 或 WAV声音。为了使声音被完全的播放,保证MIX Xtra在影片中可用,通常将它放在应用程序的Xtras文件夹中。
当声音文件与影片在不的文件夹中时,whichFile必须指定文件的全路径。
要播放从一个URL中获得的声音,通常用的好办法是先使用ownloadNetThing 或preloadNetThing()将文件下载到本地磁盘上。这个办法可以将文件下载中的问题减到最少。
sound playFile从磁盘上比从内存中播放要好。因此,使用sound playFile命令播放数字影像或将一个演员读入内存时,当电脑试图一次从磁盘的两个地方读入时会导致冲突。
例子    这个语句在通道1中播放名为Thunder的文件。
sound playFile 1, "Thunder.wav"

例子    这个语句在通道3中播放名为Thunder的文件。
sound playFile 3, the moviePath & "Thunder.wav"

参见    sound stop

sound stop
语法    sound(whichChannel).stop()
sound stop whichChannel
描述    命令;停止指定通道内的声音播放。
sound stop命令在早期版本的Director中使用。为了最好的结果,使用puppetSound命令代替它。
例子    这个语句停止通道1中任何声音的播放。
sound(1).stop()

例子    这个语句检查通道1中是否有声音在播放,若有,停止这个声音。
if soundBusy(1) then sound(1).stop()

参见    puppetSound, soundBusy()

sourceRect
语法    window whichWindow.sourceRect
the sourceRect of window whichWindow

描述    窗口属性;显示由whichWindow指定的窗口中播放影片的原始舞台大小。
这个属性通常在一个窗口被拖放或矩形大小被设置后使用以返回窗口的原始大小。
例子    这个语句在Message窗口中显示名为Control Panel的舞台的原始大小。
put window("Control Panel").sourceRect

参见    drawRect, rect()



xuyi_5d

职务:普通成员
等级:2
金币:1.0
发贴:179
注册:2000/9/19 15:56:01
#32001/3/22 15:53:23
24.SPACE
语法: SPACE
描述:衡量;只读,表示空格属性的值。
例子:在message窗口中显示字符串“Age of Aquarius":
put "Age"&SPACE&"Of"&SPACE&"Aquarius"
25.sprite
语法    sprite(whichSprite).property
the property of sprite whichSprite

描述    关键字;告诉Lingo由whichSprite(通道号)指定的值。它适用于所有的sprite属性。
一个sprite是在Score的一个sprite通道出现的一个演员。这个术语在Director player for Java中有特定的意义。不要在将一个Lingo脚本嵌入java代码时使用。
例子    这个语句将sprite 1的locH赋给名为horizontal的变量。
horizontal = sprite(1).loc

例子    这个语句在Message窗口中显示sprite通道100的当前成员名。
put sprite (100).member

参见    puppetSprite, spriteNum

26.sprite...intersects
语法: sprite(sprite1).intersects(sprite2)
sprite sprite1 intersects sprite2
描述:关键字,判断两个sprite是否重叠,交叉
例子:if sprite i intersects j then put "You placed it correctly." into member "Notice"
27.sprite...within
语法: sprite(sprite1).within(sprite2)
sprite sprite1 within sprite2
描述:关键字,判断sprite1是否在sprite2内。
例子:if sprite(3).within(2) then doInside

编辑历史:[这消息被xuyi编辑过(编辑时间2001-03-22 16:29:27)]


xuyi_5d

职务:普通成员
等级:2
金币:1.0
发贴:179
注册:2000/9/19 15:56:01
#42001/3/23 15:49:38
spriteNum
语法    spriteNum
the spriteNum of me

描述    Sprite属性;确定行为所在Spirte的通道号并使其它行为可以用到它。在行为的头部简单的声明这个属性,和其它属性一起供行为使用。
如果你使用一个新过程建立行为的一个实例,新过程的脚本必须明确设置spriteNum属性为sprite的通道号。
例子    在这个过程中,spriteNum属性自动设为系统建立的实例。
property spriteNum
on mouseDown me
    sprite(spriteNum).member = member("DownPict")
end

例子    这个过程将spriteNum自动值赋给新属性变量pMySpriteRef
property spriteNum, pMySpriteRef
on beginSprite me
    pMySpriteRef = sprite(me.spriteNum)
end
可以在脚本后面使用pMySpriteRef。
currMember = pMySpriteRef.member
下列语句可以代替,但稍微有些长。
currMember = sprite(spriteNum).member
这两个语句只是在方便时任意选择,功能并无不同。
参见    on beginSprite, on endSprite, currentSpriteNum

28.sqrt()
语法: sqrt(number)
the sqrt of number
描述:数学函数。
例子:put sqrt(3)
29.stage
语法: the stage
描述:系统属性;引用主要的电影。这属性起作用的时候,把信息从子电影送到主电影的命令。
例子:put the stage.rect
--rect (0, 0, 640, 480)
30.stageBottom
语法:the stageBottom
描述:函数;和stageLeft一起,stageRight和stageTop表示舞台被置于桌面的地方。
它还返回主屏幕的左上方角有关系的舞台的底部的垂直的坐标。
例子:sprite(3).locV = stageHeight - 50
参见:stageLeft, stageRight, stageTop, locH, locV
31.stageColor
语法: the stageColor
描述:系统属性,确定舞台的背景颜色

stageLeft
语法    the stageLeft
描述    函数;同stageRight, stageTop, 和 stageBottom一起使用,指出舞台在桌面上的坐标。它返回相对于主屏幕左上角的左水平坐标。当舞台与主屏幕的左边齐平时,坐标为0。
当影片作为一个applet播放时,stageLeft属性为零,它是applet左边的位置。
这个属性可以被检验,但不能被设置。
Sprite坐标的表示相对于舞台的左上角。
例子    这个语句检查舞台的左边缘是否超过屏幕的左边缘,如果是的话调用leftMonitorProcedure过程处理。
if the stageLeft < 0 then leftMonitorProcedure
参见    stageBottom, stageRight, stageTop, locH, locV

语法    the stageRight
描述    函数;同stageRight, stageTop, 和 stageBottom一起使用,指出舞台在桌面上的坐标。它返回相对于主屏幕左上角的右水平坐标。舞台的像素宽度用the stageRight - the stageLeft确定。
当影片作为一个applet播放时,stageRight属性为applet的像素宽度。
这个属性可以被检验,但不能被设置。
Sprite坐标的表示相对于舞台的左上角。
例子    这两个语句把sprite 3的位置定为距舞台右边缘50像素。
stageWidth = the stageRight - the stageLeft
sprite(3).locH = stageWidth - 50
参见    stageBottom, stageLeft, stageTop, locH, locV

32.stageToFlash()
语法: sprite(whichFlashSprite).stageToFlash(pointOnDirecto rStage)
stageToFlash (sprite whichFlashSprite, pointOnDirectorStage)
描述:函数;返回flash精灵的坐标以适应舞台的坐标。
例子:
on checkFlashRollover
     if sprite(5).stageToFlash(point(the mouseH,the mouseV)) = point(130,10) then
        sprite(5).stop()
     end if
end

stageTop
语法    the stageTop
描述    函数;同stageRight, stageTop, 和 stageBottom一起使用,指出舞台在桌面上的坐标。它返回相对于主屏幕左上角的顶部坚坐标。当舞台与主屏幕的左边齐平时,坐标为0。
当影片作为一个applet播放时,stageLeft属性为零,它是applet左边的位置。
这个属性可以被检验,但不能被设置。
Sprite坐标的表示相对于舞台的左上角。
例子    这个语句检查舞台的左边缘是否超过屏幕的左边缘,如果是的话调用leftMonitorProcedure过程处理。
if the stageTop < 0 then upperMonitorProcedure
参见    stageBottom, stageLeft, stageRight, locH, locV

33.startFrame
语法: sprite(whichSprite).startFrame
描述:返回sprite span 的开始帧数。这个函数的功能对特别的sprite覆盖的帧数决定跨距有用。
例子:put sprite(5).startFrame
34.on startMovie
语法: on startMovie
statement(s)
end
描述:系统信息,并且事件管理者;包括播放头进入电影以前的第一个结构的陈述。
例子:当电影开始的时候,使sprite(10-50)不可见:
on startMovie
    repeat with counter = 10 to 50
        sprite(counter).visible = 0
    end repeat
end startMovie