
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Onward!
|
273
Onward!
This chapter gave you an introduction to—and considerable practice using—your
first composite datatype, arrays. Now that you understand how multiple pieces of
data can be represented within a single container, you have a solid foundation to
take into Chapter 12. There we’ll explore an even more powerful type of composite
data—and a fundamental component of ActionScript—objects.
// Customize the font face, size, and color of the text field.
var formatObj = new TextFormat( );
formatObj.size = 16;
formatObj.color = 0xC7FF9C;
formatObj.font = "_sans";
formatObj.bold = true;
quizTimeline.totalOutput_txt.setTextFormat(formatObj);
}
// =================================
// DEFINE QUIZ BUTTON EVENT HANDLERS
// =================================
// Code executed when button 1 is pressed.
choice1_btn.onRelease = function ( ) {
// Call answer( ), which records the user's choice
// and advances the quiz to the next question.
this._parent.answer(1);
};
// Code executed when button 2 is pressed.
choice2_btn.onRelease = function ( ) {
this._parent.answer(2);
};
// Code executed when button 3 is pressed.
choice3_btn.onRelease = function ( ) {
this._parent.answer(3);
};
Example 11-7. A multiple-choice quiz, version 3 (continued)