Flash编程无基础入门教程
// in the array except the last
questionsArray = [new Question (2,
"Which version of Flash first introduced movie clips?",
["version 1", "version 2", "version 3",
"version 4", "version 5", "version 6"]),
new Question (2,
"When was Action formally declared a ing language?",
["version 3", "version 4", "version 5"]),
new Question (1,
"Are regular expressions supported by Flash 5 Action?",
["yes", "no"]),
new Question (0,
"Which sound format offers the best compression?",
["mp3","aiff", "wav"]),
new Question (1,
"True or False: The post-increment operator (++) returns the
value of its operand + 1.",
["true", "false"]),
new Question (3,
"Action is based on...",
["Java", "Java", "C++", "ECMA-262", "Perl"])];
//// 离开questionsArray.as部分,我们继续
// Begin the quiz 出题目!调用makeQuestion函数来完成,我们只需要给这个函数一个参数:题目的编号,函数就会按编号提取数据,结合我们刚才做的模版生成题目。
makeQuestion(currentQuestion);
// Function to render each question to the screen
// 下面就是makeQuestion函数
function makeQuestion (currentQuestion) {
// Clear the Stage of the last question
//这句是清理上一题生成的MC,这句从第二题开始生效,questionClip就是题目的MC名,MC从哪来的?看下面就知道了
questionClip.removeMovieClip();
// Create and place the main question clip
// 利用模版questionTemplate生成一个叫questionClip的MC,这个MC就是我们的问题
attachMovie("questionTemplate", "questionClip", 0);
// 设定MC的位置
questionClip._x = 277;
questionClip._y = 205;
// 把题目编号输入MC的qNum文本框中
questionClip.qNum = currentQuestion + 1;
// questionsArray[currentQuestion]就是数组questionsArray里的第currentQuestion个对象,例如currentQuestion是0,那么就是我们的第一条题目
// questionsArray�.questionText就是第一条题目对象的问题属性
[文章热度:]
123456789101112131415161718192021
上一页:Flash 物理效果收藏
下一页:Flash As编码习惯