一、在场景中输入以下题目
选择恰当的词语填在横线上:
我们没有山峰的峻峭,可以有峡谷的 ;我们没有大海的辽阔,可以有小溪的 ;我们没有蓝天的高远,可以有白云的 ;我们没有太阳的光亮,可以有星星的闪亮。
二、制作备选答案
(1)点击【插入】|【新建元件】|【影片剪辑】,进入编辑区,用文本工具(静态文本)输入备选答案“清澈”。
(2)返回场景,将此影片剪辑拖入景场中,放在适当的位置,并取实例名称为【daan1】,同理制作别外两个备选答案“幽深”“飘逸”,取实例名称分别为【daan2】【daan3】。
三、制作横线上的透明影片剪辑
点击【插入】|【新建元件】|【影片剪辑】,进入编辑区,用矩形工具画一个无边框的矩形,返回场景,将此元件拖放到第一条横线上。然后选中此元件,在属性面板【颜色】处将其【Alpha】设为0,并取实例名称为mc1。同理制再拖两次该元件到另两条横线上,分别将其【Alpha】设为0,取实例名称为mc2、mc3。
四、制作对错影片剪辑
(1)点击【插入】|【新建元件】,选择【影片剪辑】进入编辑区。点击图层1第二帧鼠标右键单击,插入【空白关键帧】,然后选择【线条工具】,笔触颜色为红色,在舞台中间绘制一个红色的对勾。
(2)点击图层1第二帧鼠标右键单击,插入【空白关键帧】,然后选择【线条工具】,笔触颜色为红色,在舞台中间绘制一个红色的差。(与上一步画红色对勾方法相同,需要注意的是绘制的图形尽量按排在中间,即十字架处)
(3)选中图层1第1帧,打开动作面板,在代码编辑区输入代码:stop().
(4)返回场景,按【ctrl+L】键打开库面板,将制作好的对错影片剪辑拖在题目的横线后边(要拖三次,因为有三条横线),然后选中此影片剪辑,在属性面板中分别取实例名称为【duichuo1】【duichuo2】【duichuo3】。
五、编写代码
//答案1代码:
daan1.onPress = function() {
daan1.startDrag();
};
daan1.onRelease = function() {
if (this.hitTest(_root.mc2)) {
duicuo2.gotoAndStop(2);
} else if (this.hitTest(_root.mc1)) {
duicuo1.gotoAndStop(3);
} else if (this.hitTest(_root.mc3)) {
duicuo3.gotoAndStop(3);
}
daan1.stopDrag();
};
//答案2代码:
daan2.onPress = function() {
daan2.startDrag();
};
daan2.onRelease = function() {
if (this.hitTest(_root.mc1)) {
duicuo1.gotoAndStop(2);
} else if (this.hitTest(_root.mc2)) {
duicuo2.gotoAndStop(3);
} else if (this.hitTest(_root.mc3)) {
duicuo3.gotoAndStop(3);
}
daan2.stopDrag();
};
//答案3代码:
daan3.onPress = function() {
daan3.startDrag();
};
daan3.onRelease = function() {
if (this.hitTest(_root.mc3)) {
duicuo3.gotoAndStop(2);
} else if (this.hitTest(_root.mc1)) {
duicuo1.gotoAndStop(3);
} else if (this.hitTest(_root.mc2)) {
duicuo2.gotoAndStop(3);
}
daan3.stopDrag();
};