Quiz (ONLY commercially available)

Package:
Class:
Inheritance:
biz.flashscript.components.quiz
public class Quiz
AbstractClass extends Sprite
The Quiz component allows to execute complex xml-based surveys and quizes. To create an instance of the DateChooser component place an instance of the component on the main timeline or call the Quiz class (see example on this page). To create an instance of the Quiz use the constructor new Quiz().
Public Properties tr> tr> tr> tr> tr>
Property Defined By
quizXML : String
Specifies the URL to the xml file for the quiz.
Quiz
quizPHP : String
Specifies the URL to a php file in case the quiz results should be further published online.
Quiz
butY : int
Specifies the y-position of buttons, when the height is changed.
Quiz
quizWidth : int
Specifies the width of the quiz.
Quiz
quizHeight : int
Specifies the height of the quiz.
Quiz
showCorAnswer : Boolean
Specifies if only the answers should be shown or also possible points and the correct answer.
Quiz
Public Methods
Method Defined By
All inherited methods of the AbstractCalendar class. N/A
Events
Event Defined By

quizCompleted

This event is dispatched when the last question was answered.

Quiz
All inherited events for the AbstractCalendar class. N/A
Property Detail

quizXML property
quizXML:String [read-write]

Specifies the URL to the xml file for the quiz.

There is no default value.

Implementation

public function get quizXML():String
public function set quizXML(value:String):void

quizPHP property
quizPHP:String [read-write]

Specifies the URL to a php file in case the quiz results should be further published online.

There is no default value.

Implementation

public function get quizPHP():String
public function set quizPHP(value:String):void

butY property
butY:int [read-write]

Specifies the y-position of buttons, when the height is changed.

The default value is 270..

Implementation

public function get butY():int
public function set butY(value:int):void

quizWidth property
quizWidth:int [read-write]

Specifies the width of the quiz.

The default value is 550..

Implementation

public function get quizWidth():int
public function set quizWidth(value:int):void

quizHeight property
quizHeight:int [read-write]

Specifies the height of the quiz.

The default value is 300..

Implementation

public function get quizHeight():int
public function set quizHeight(value:int):void

showCorAnswer property
showCorAnswer:Boolean [read-write]

Specifies if only the answers should be shown or also possible points and the correct answer.

The default value is false..

Implementation

public function get showCorAnswer():Boolean
public function set showCorAnswer(value:Boolean):void
Constructor Detail
Quiz ()  Constructor
public function Quiz()
Creates a new instance of the Quiz.
Event Detail

quizCompleted event

Event Object Type: biz.flashscript.components.quiz
Event.type property = biz.flashscript.components.quiz.Quiz.QUIZ_COMPLETED

Dispatched when the day buttons are pressed.

Examples
Create a new fla file and name it DateChooser.fla. Save the file in the same folder where the biz folder is located. Drag an instance of the DateChooser component on stage from the component menu and delete it. Then create an Actionscript file, name it Datechooser.as and place this script.

package 
{
	import flash.display.Sprite;
	import biz.flashscript.components.quiz.Quiz;
	import flash.events.MouseEvent;
	import flash.net.navigateToURL;
	import biz.flashscript.components.buttons.CustomButton;
	import flash.net.URLRequest;
	import flash.events.Event;

	public class QuizExample extends Sprite
	{
		private var mc:Quiz;

		public function QuizExample ():void
		{
			mc = new Quiz();
			addChild (mc);
			mc.showCorAnswer = true;
			mc.quizXML = "quiz/multiple_choice.xml";
			mc.addEventListener (Quiz.QUIZ_COMPLETED, completeHandler);
		}
		private function completeHandler (event:Event):void
		{
			trace("completed");
		}
	}
}