◆ 网页平面多媒体培训、认证考试免费咨询热线:400-700-5807 进入网络咨询平台 ◆
(7) 在Movie脚本中,添加以下Lingo控制语句,如图8-35所示。
on new me,spritenum0,totalsteps0,radius0,stepsize0,centerx0,centery0
put spritenum0 into spritenum
put totalsteps0 into totalsteps
put radius0 into radius
put stepsize0 into stepsize
put centerx0 into centerx
put centery0 into centery
put 0.0 into stepnum
puppetsprite spritenum,true
show(me)
return me
end
on show me
put cos((stepnum/totalsteps)*2*pi())*radius+centerx into x
put sin((stepnum/totalsteps)*2*pi())*radius+centerx into y
set the loc of sprite spritenum = point(x,y)
end
on move me
put stepnum+stepsize into stepnum
show (me)
end
on kill me
puppetsprite spritenum,false
end

图8-35 Movie脚本中的句柄
(8) 打开Property Inspector对话框的Member选项卡,在Movie脚本的Name文本框中输入“hehe”名称,如图8-36所示。

图8-36 设置脚本的名称
(9) 在舞台窗口中,右击精灵1,在弹出来的快捷菜单中选择Script命令,在弹出的Script窗口中输入以下Lingo控制语句,如图8-37所示。
on mouseWithin
global circle
set circle = new(script"circleobject",2,180,180,2,225,225)
end mouseWithin

图8-37 精灵1的Lingo脚本
(10) 在Score窗口的Script通道中,双击第1帧,在弹出的Script窗口中,设置以下Lingo控制语句,如图8-38所示。
on exitFrame me
global circle
go to the frame
move(circle)
repeat with i = 1 to 30
sprite(2).rotation= i*12
updatestage
end repest
end

图8-38 第1帧的Lingo脚本
(11) 至此,地球围绕太阳公转和地球自转的动画的制作完成了。播放效果如图8-39所示。

图8-39 公转与自转动画效果 上一页 [1] [2]
 【责编:runlz】 |