查看: 1144|回复: 11
|
如何在五秒后显示出答案?
[复制链接]
|
|
嗨。。
我正在做着一个flash填充题,让学生填写答案,回答后,学生可按“检查”来看看是否答对了。
如果答案是错的,在五秒钟后,答案将会显示出来。 请问我要如何在五秒钟后,把对的答案显示出来?
我现在用着, 就是5秒后, 跑去showRightAnswers 的 function:
counter = setInterval(showRightAnswers, 5000);
可惜,还是做不成
有谁能够帮帮我?谢谢 |
|
|
|
|
|
|
|
发表于 21-9-2005 10:01 AM
|
显示全部楼层
我想可以用getTimer()来拿时间。当他按check answer后,就stop(),然后getTimer(),当时间超过5000(因为他是 get the number of milliseconds,用LOOP来check他是否超过5秒)就去答案。。。 |
|
|
|
|
|
|
|
发表于 21-9-2005 01:45 PM
|
显示全部楼层
showRightAnswers = function() {
clearInterval(counter);
//show your events here
}
if(!answer) counter = setInterval(showRightAnswers, 5000); |
|
|
|
|
|
|
|

楼主 |
发表于 21-9-2005 04:25 PM
|
显示全部楼层
This is part of the code written
on(release)
{
.
.
.
.
else if(c<8) //if correct answers less than 8
{
control =setInterval(showRightAnswers, 5000);
showRightAnswers(); //call function
}
}
------------------------------------------------------
function of showRightAnswers() is written on the first frame as below:
function showRightAnswers()
{
index = 0;
temp = 0;
for(index = 0; index < 8; index++)
{
if(inputs[index].text == ""
{
inputs[index].textColor= 0xFF0000;
inputs[index].text = answers[temp];
temp ++;
}
}
clearInterval(control);
}
可是还是做不到啊?怎么办?
[ 本帖最后由 杏心 于 21-9-2005 04:28 PM 编辑 ] |
|
|
|
|
|
|
|

楼主 |
发表于 21-9-2005 04:27 PM
|
显示全部楼层
原帖由 aksin 于 21-9-2005 10:01 AM 发表
我想可以用getTimer()来拿时间。当他按check answer后,就stop(),然后getTimer(),当时间超过5000(因为他是 get the number of milliseconds,用LOOP来check他是否超过5秒)就去答案。。。
可以详细说明吗?不是很明白 |
|
|
|
|
|
|
|
发表于 22-9-2005 01:01 AM
|
显示全部楼层
control =setInterval(showRightAnswers, 5000);
showRightAnswers(); //完全不必要這行
最好上傳你的文件,不然不明白你的情況。 |
|
|
|
|
|
|
|

楼主 |
发表于 22-9-2005 08:32 AM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 22-9-2005 11:04 AM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 22-9-2005 11:34 AM
|
显示全部楼层
行了,感激不尽!  |
|
|
|
|
|
|
|
发表于 22-9-2005 06:49 PM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 22-9-2005 08:20 PM
|
显示全部楼层
可能之前没放 "_root." 在 showRightAnswers 那里吧。。 |
|
|
|
|
|
|
|
发表于 23-9-2005 10:30 AM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|