第8章脚本和脚本动画第五节.ppt.ppt
文本预览下载声明
第8章 脚本和脚本动画第五节 第8章 脚本和脚本动画第五节 Lingo中一些常用Lingo。 1、改变鼠标的形状--cursor On mouseEnter Cursor 260 --手型光标 End 较常用的几种光标形状代码如下: 空光标 0 普通箭头光标 -1 十字交叉光标 2 沙漏光标 4 较常用的几种光标形状代码如下: I字型光标 1 手型光标 260 十字交叉光标 2 手指型光标 280 2、判断鼠标是否处于被按下的状态 –the stillDown 例如拖动角色的脚本 On exitframe Repeat while the stillDown Set the locH of sprite 1 to the mouseH Set the locV of sprite 1 to the mouseV Updatestage End repeate End 3、键盘的控制 The key、 the keyPressed 、the keyCode The key 这个属性可以接受用户键入的一个键所代表的字符,这个字符一般是用户在一系列的击键中最后击中的一个键所代表的值。 如:On exitframe Go to the frame Repeat with i=1 to 100 set the text of field “thirdfield” =the key End repeate End the keyPressed的属性的值是随时变化的,可以循环接受用户输入。 如: On exitframe Go to the frame Repeat with i=1 to 100 set the text of field “firstfield” =the keypressed End repeate End The keyCode它是接受某个键的数字值,敲击的一系列键中的最后一个键的值。 如:上箭头的值是126;下箭头的值是125 4、时间控制 获取时间有:the time 、 the long time 、 the short time 、the abbreviated time 、the abbrev time 、the abbr time 与日期有关的属性与这六个属性非常相似。 the date 、 the long date 、 the short date 、the abbreviated date 、the abbrev date 、the abbr date Delay--延迟 On exitframe Delay 180 --使电影延迟一定时间运行 End 5、打开硬盘中的文件 Open “windows” withmydrive “c:\windows\mshearts.exe” 6、播放电影Play movie “电影一” Play movie “电影二” 7、the clickOn和the mouseMember the clickOn用来判断鼠标点击在那一个精灵上。返回精灵所在的通道号,如果没有精灵,则返回0. The mouseMember用来判断鼠标是否正停在某个精灵上的属性。它的返回值是这个精灵的所在通道号。 Put “鼠标点击在第the clickon个精灵上” Put “精灵在第”the mousemember”个通道上” -- 鼠标点击在第2个精灵上“ -- 鼠标点击在第the clickon个精灵上 精灵在第(member 3 of castLib 1)个通道上 例题: 1、如果要在Message中输出以下信息: “3+2=5” put “3+2=5” put “1212155264+45788=” 2、把“3+2=5”显示到文本域“firstfield”中 Set the text of field firstfield to “3+2=5” 3、把文本域“firstfield”中的内容放到文本域“secondfield”中 Set the text of field “secondfield” to the text of field “firstfield” 4、显示精灵的属性 Put “精灵1的高度为:”the height of sprite 1 Put “精灵1的宽度为:”the width of sprite 1 Put “精灵1的上边界为:”the top of sprite 1 Put “精灵1的下边界为:”the bot
显示全部