主题:  otherwise至pictureP()共29条

singingboy

职务:普通成员
等级:1
金币:0.0
发贴:48
注册:2000/11/24 13:17:37
#12001/7/19 11:20:29
otherwise
语法:otherwise statement(s)
说明:关键字;当在以case开始的声明中没有遇到响应的条件时,执行此关键字后面的语句。
这个关键字可以被用来提醒用户超出范围的输入或者不正确的类型,而且在开发过程中用于调试也是很有帮助的。
例子:下面的句柄检验用户最近按下了哪一个键并且作出反应:
.如果用户按下了A、B或C,影片执行of关键字的相应的动作。
.如果用户按下了其他的键,影片执行otherwise关键字后面的声明。在这里,声明是一个简单的提醒。
on keyDown
     case (the key) of
        "A": go to frame "Apple"
        "B", "C":
            puppetTransition 99
            go to frame "Oranges"
        otherwise:
            alert "That is not a valid key."
     end case

end keyDown

pageheight

语法:member(whichCastmember).pageHeight

the pageHeight of member whichCastmember
说明:域演员表成员属性;以象素为单位,返回域演员表成员在舞台上的可见区域的高 度。
此属性可以被检测,但不可以设置;
例子:下面的声明可以返回域演员表属性"Today's News"可见部分的高度:
put the pageHeight of member "Today's News"

palette:
语法:member(whichCastmember).palette

he palette of member whichCastmember
说明:演员表成员属性;只适用于Bitmap演员表成员,确定由whichCaseMember 指定的调色板与演员表成员相关联。
此属性可以被检测和设置。
例子:下面的声明在消息窗口中显示与演员表成员相关联的调色板:
put the palette of member "Leaves"

paletteMapping
语法:the paletteMapping
说明:影片属性;确定影片的演员表成员映射的调色板与当前影片的调色板是否一致。它的功能与影片属性窗口中的Remap Palettes When Needed复选框一致。
为了同时在不同的调色板中显示不同的位图,设置paletteMapping 为真。DIRECTOR观察每个在舞台上的演员表成员所关联的调色板,如果不同于当前的调色板,则在信的调色板中查找最接近的像素值来替换;
不匹配的位图的颜色将会选择原始色;
映射花费了处理器的时间,所以通常提前调整调色板是一个比较好的办法;
映射也可以长生不可预测的后果。如果调色板改变的范围在中间区域的话,位图立即映射新的调色板并且可能显示错误的颜色。然而,如果有任何屏幕的过渡,或者sprite在舞台上移动,受影响的区域会使用映射的颜色。
例子:下面的声明告诉影片尽可能的使用影片自带的调色板;
set the paletteMapping=TRUE


paletteRef
语法:the paletteRef
说明:Bitmap演员表成员属性;确定一个Bitmap演员表成员相关联的调色板。内建于Director的调色板由标志来说明(#systemMac,#rainbow,and so on).
作为演员表成员的调色板被视为演员表成员参数。此行为不同于the palette成员属性,如果为演员表调色板则返回一个正书,如果为Director内建的调色板则返回一个负数。
此属性可以被检测和设置。
例子:下面的声明分配Macintosh系统的调色板给Bitmap演员表成员:
set the paletteRef of member "Shell" to #systemMac

pan
语法:pan of sprite whichQTVRSprite
说明:QTVR sprite 属性;当前的QTVR影片的面板。值用度来表示。
此属性可以被检测和设置。

paragraph
语法:chunkExpression.paragraph[whichParagraph]

chunkExpression.paragraph[firstPara..lastPara]
说明:文本演员表成员属性;chundExpression允许在一个文本演员表成员中存取不同的段落。
paragraph以RETRUN字符为分界符。
参见:line…of

param()
语法:param(parameterPosition)
描述:函数;把一个参数的值传递给一个处理程序。表达式parameterPosition表示参数在参数列表中的位置。
为了避免在一个处理程序中出现错误,这个函数可以被用来确定一个特殊参数的类型。
例子:这个处理程序接收参数列表中的每个数字,把以参数方式传递的数字加起来并且返回它们的和:
on AddNumbers
    sum = 0
    repeat with currentParamNum = 1 to the paramCount
        sum = sum + param(currentParamNum)
    end repeat
    return sum

end

你可以用它来传递你想要相加的数值:

put AddNumbers(3, 4, 5, 6)
-- 18
put AddNumbers(5, 5)
-- 10

参见:getAt, param(),paramCount(),return (keyword)

paramCount()
语法:the paramCount
描述:函数;指出发送到当前处理程序的参数的个数。
例子:下面的声明把传递给当前处理程序的参数的个数赋值给变量counter.
set counter = the paramCount

pass
语法:pass
描述:命令;忽略一个事件消息,执行消息层中的下一个位置的消息,并且能够为一个给定的时间执行多于一个处理程序。
java的Director player 只有在附属于可编辑的sprites的on keyDown,on keyUp处理程序时支持此命令。
默认情况下,一个事件消息停留在第一个包含处理程序的位置,通常是在sprite上。
包含pass命令的处理程序使得事件直接传递到队列中的其他对象,即使这个处理程序将会中途阻止这个事件。
例子:这个处理程序检验正在输入的按键值,如果它们是有效的字符则通过到达可编辑文本sprite.
on keyDown me
    legalCharacters = "1234567890"
    if legalCharacters contains the key then
        pass
    else
        beep
    end if

end

参见:stopEvent

pasteClipBoardInto
语法:pasterClipBoardInto membe whichCastmember
说明:命令;粘贴剪贴板中的内容到由whichCastMember制定的演员表成员,并且擦除已经存在与演员表成员中的内容。例如,粘贴一个位图到一个域演员表成员,不仅会擦除域演员表成员而且会使它变成一个位图演员表成员。
你可以粘贴在DIRECTOR中能够使用的任何一个演员表成员。当你从其它的应用程序中拷贝字符串,此字符串的格式不会被保留。
PasteClipBoardInto命令可以方便的从其它的影片中或者其它的应用程序中拷贝对象到演员表窗口。因为拷贝演员表成员必须把它存储在RAMZ中,所以你应该避免在内存短缺的时候使用此命令;
提示:在Shockwave中,或在编辑环境和sagePlayer属性被设置为TRUE的工程中,此命令才执行时,会弹出一个警告窗口提示用户取消此操作。
例子:下面的声明粘贴剪贴板中扥诶蓉道明威“Shrine"的位图演员便成员中:
pasteClipBoardInto member "Shrine"
参见:sagePlayer

pathName(movie property)
此命令已经过时。现在使用moviepath。

pathName(castmember property)
语法:member (whichFlashMember).pathName;
the pathName of member whichFlashMember
说明:演员表成员属性;控制一个Flash影片演员表成员存储的外部文件路径的定位。你可以在本地硬盘或者网络驱动器或RUL上链接一个FLASH影片;
通过pathName属性可以把一个非链接的演员表成员设置为链接文件;
此属性可以被检测和设置。为链接成员的pathName属性值为空。
此属性与另外一个名为fileName属性相同,而且fileName可以代替pathName。
例子:此脚本使用new命令创建一个新的flash演员表成员,设置新建立的演员表成员链接属性,使此演员表成员以一个外部文件存储,然后设置它的pathName属性只想World Wide Web 上的一个flash影片;
on startMovie
set flashCastMember = new (#flash)
set the pathName of member flashCastMember="httP://www.someURL.com/myFlash.swf"
end
参见:fileName(cast member proprety),linked

pattern
语法:member(whichCastmember).pattern
the pattern of member whichCastmember
说明:演员表成员属性;

pause
此命令已经过期,现在使用 go to the frame .

pausedAtStart
语法:member(whichFlashOrDigitalVideoMember).pausedAtStart
the pausedAtStart of member whichFlashOrDigitalVideoMember
sprite(whichFlashSprite).pausedAtStart
the pausedAtStart of sprite whichFlashSprite
说明:演员表成员属性和sprite属性;当sprite出现在舞台上时控制数字视频或者flash影片,如果属性为TRUE,当sprite出现时不会播放视频文件或flash影片,如果此属性为false ,则当sprite出现在舞台时立即播放。
语法 pausedAtStart of sprite whichFlashSprite 专用于flash影片。
对于数字视频演员表成员,此属性指定在数字视频演员表成员属性的对话框中的Paused at Start复选框是否别选中;
此属性可以被检测和设置。
例子:下面的声明使名为Rotating Chair的 QuickTime 的Pause at Start 属性被选中;
set the pausedAtStart of member "Rotating Chair"=TRUE
例子:这个sprite脚本使得一个Flash 影片在它将要显示在舞台上时使它停止:
on beginsprite me
set the pausedAtStart of sprite the spriteNum of me = TRUE
end
参见:play

pause member
语法:pause member ("whichCastmember")
说明:命令;暂停一个Shockwave Audio(SWA)演员表成员。当声音停止时,state成员属性等于4。声音文件的其余部分已经被下载而且随时可以继续播放,除非缓存被用完;
例子:下面的处理程序可以被用于播放或者暂停按钮。如果声音者在被播放,这个处理程序暂停声音;否则,这个处理程序播放演员表中的成员"soundSWA";
on mouseDown
    set whatState = the state of member "soundSWA"
    if whatState = 3 then
        pause member "soundSWA"
    else
        play member "soundSWA"
    end if

end

参见:play member, stop member

pause sprite
语法:pause(sprite whichGIFSpriteNumber)
说明:命令;使一个Animatec GIF sprite 的播放头暂停在当前的帧上。
参见:resume,rewind

pauseState
语法:the pauseState
说明:影片属性;确定是否用pause命令暂停(TRUE)或者继续播放(false)影片;
pause命令已经过时,因此此属性不建议使用;
例子:下面的声明检查当前影片是否被暂停,如果是则跳到下一帧继续执行影片:
if the pauseState = TRUE the go the frame + 1
参见:pause

percentPlayed
语法:member(whichCastmember).percentPlayed

the percentPlayed of member whichCastmember
说明:Shockwave Audio (SWA) 演员表成员属性;返回指定的SWA文件已经播放的百分比。
此属性只有在SWA开始播放了以后或者已经被用preLoadBuffer命令预加载过。此属性不可以被设置。
例子:此处理程序显示SWA streaming 演员表成员"Frank Sinatra"已经被播放的百分比并且把它的值输出到域演员表成员"Percent Played"中:
on exitFrame
    set whatState = the state of member "Frank Sinatra"
    if whatState > 1 AND whatState < 9 then
        put the percentPlayed of member "Frank Sinatra " into member "Percent Played"
    end if

end
参见:percentStreamed

percentStreamed
语法:member(whichCastmember).percentStreamed

the percentStreamed of member whichCastmember
说明:Shockwave Audio (SWA) 演员表成员属性;取得一个SWA文件已经从HTTP或者FTP服务器(SWA streaming 声音服务器)传出的百分比,或者一个flash影片的已经下载到内存中的百分比(对于flash影片演员表成员)。此属性为一个从0 到100%的值;
对于SWA,此属性不同于the percentPlayed 属性,此属性包括所有已经存入缓存器中的文件,不仅仅是正在播放的文件。
此属性只有在SWA开始播放了以后或者已经被用preLoadBuffer命令预加载过。此属性不可以被设置。
例子:下面的例子显示SWA streaming 演员表成员"Ray Charles"已经下载的百分比并且把它的值装入一个域:
on exitFrame
    set whatState = the state of member Ray Charles"
    if whatState > 1 AND whatState < 9 then
        put the percentStreamed of member "Ray Charles " into member "Percent Streamed Displayer"
    end if

end
例子:下面的帧脚本时播放头在当前帧循环,直到这个名为"Splash Screen"的Flash影片已经被载入内存超过60%;
on exitFrame
    if the percentStreamed of member "Splash Screen" < 60 then go to the frame
end if

end
参见:percentPlayed

PI
语法:PI
说明:常量;返回的pi值,直径的圆周率,小数点后面的精确数由floatPrecision属性指定。
例子:下面的声明使用pi常量作为表达式的一部分以求出一个圆周的面积:
set vArea = PI * power(vRadius,2)

picture(case member property)
语法:member(whichCastmember).picture
the picture of member whichCastmember
说明:演员表成员属性;确定与bitmap,text,PICT演员表成员相关联的图片。更新一个图像的注册点或者更新重新链接的图像使用fileName属性,如下面的声明:
set the picture of member whichCastmember = the picture of member whichCastmember
用需要操作的演员表成员的名字或者数字替换掉whichCasemember的部分;
因为改变的演员表成员存储在RAM中,这个属性最好用于编辑状态。不要在工程中使用。
此属性可以被检测和设置。
例子:下面的声明把名为"Sunset"的图像演员表成员赋值给变量picHolder
参见:type(sprite property)

picture (window property)
语法:    the stage.picture
the picture of the stage
window whichWindow.picture
the picture of window whichWindow

说明:窗口属性;这个属性提供了一个取得当前窗口内容中的图片的方法(包括舞台窗口和窗口中的窗口)。
返回的结果可以赋值给一个已有的位图或者创建一个新的位图。
此属性可以被检测和设置。
例子:下面的声明获取当前舞台上的内容并且把它赋给一个位图演员表成员。
set the picture of member "stage image"=the picture of the stage
参见:media,picture(cast member property)

pictureP()
语法:pictureP(picturevalue)
说明:函数;指出一个特定的演员表成员的picture成员属性的状态,TRUE(1)或FALSE(0);
因为pictureP不可以直接的检查是否一个图片连接在一个演员表成员,你必须通过检查演员表成员的picture 成员属性对一个图片进行检验;
例子:第一个声明把一个位图演员表成员"Shrine"的的picture成员属性的值分配给一个变量picturevalue.第二个声明检测通过检测由picturevalue分配的值来确定Shrine是否是一个图片;
set picturevalue to the picture of member "Shrine"

put pictureP(picturevalue)

结果为1 ,相当于TRUE。

编辑历史:[这消息被机器猫编辑过(编辑时间2001-07-20 16:22:45)]