#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