Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CheckBox Woes

Status
Not open for further replies.

boab

Programmer
May 30, 2001
75
GB
If anyone can help I'll be eternally grateful. What I am trying to do is build a component to build quiz questions most of the types of question are fairly easy:-
typed answer, essay answer, true/false

The problems come when I want to build multiple choice questions. What I have done is to build a movie clip called OptionBox (the reason being, I want to asign other values inside the movie not used directly on the CheckBox & it's easier to move the Movie clip as opposed to the CheckBox component)to use as a component when the user selects the multiple choice question type they are asked how many answers they would like. The movie then attaches the required number of instances of the OptionBox movie the code is below

create_boxes(5,20);
function create_boxes(num,dis){
for(var i=1; i<=num;i++){
var id = "Option "+String(i);
var yPos;
if(num==1){
yPos =0;
}else{
yPos = i*dis;
}
attachMovie("OptionBox", id, i, {_x:0,_y:yPos});
}
}

The problem that I have I that I want to assign the .label to a string value by using the id variable that I defined above.

What I have thought about is defining a variable in
OptionBox and then using this to set the value of the CheckBox component inside OptionBox but I am unsure of the way to go about this or if it is the best way to do it? Any suggestions would be appreciated





THe Start of wisdom is to realise you know nothing. I'll be a genius then!
 
Movies that can be attached are the same as components except with components the parameters can be added by a non actionscript user in the properties box. As for the label I would allow the user to set the label from either a text script that is loaded with LoadVars, or a custom gui swf in the properties box for a component.

Do you want the user to be able to check more than one answer. If so a radio button is more appropiate.

Are you using 2004 or Flash MX?

Thanks
Pat
ideas@microwebber.com
 
I am using 2004

What I want to do is have about 5 different types of question

Multiple Choice - Multiple Answer
Multiple Choice - Single Answer
True/False
Short Typed answer - Just a text Input
Essay Answer - a TextArea component

The first three are variations on a theme the main problem I am having is assigning the labels.

The custom GUI in the properties box for the component is the way I am looking to go with a scrollbar panel for users who want to go for lots of options the other thing that want to do is have a check box in the GUI to allow the user to specify the correct answer(s).

THe Start of wisdom is to realise you know nothing. I'll be a genius then!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top