Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-17-2003, 11:41 PM   #1
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default combox quiz

ActionScript Code:
vat total = 0; var q1Labels = new Array("Webdesign","Database","Animation"); var q1Data = new Array(1,2,3); for(var i = 0; i<q1Data.length; i++){     q1_cb.addItem(q1Labels[i],q1Data[i]); } q1_cb.setChangeHandler("onItemPicked"); /*onItemPicked = function(){     trace(test_cb.getSelectedItem().data); }*/ var q2Labels = new Array("Microsoft","Flashy","Macromedia"); var q2Data = new Array(1,2,3); for(var i = 0; i <q2Data.length; i ++){     q2_cb.addItem(q2Labels[i],q2Data[i]); } var q3Labels = new Array("Shockwave Plug-in","All Macromedia", "Flash plug-in"); var q3Data = new Array (1,2,3); q3_cb.setSize(150); for(var i = 0; i <q3Data.length; i++){     q3_cb.addItem(q3Labels[i],q3Data[i]);     q3_cb.getSelectedItem() } var correctAnswers = new Array(3,3,3); function chkAnswers(){     for (i= 1; i<=correctAnswers.length; i++){         if(q[i]_cb.getSelectedItem().data == correctAnswers[i]){             total++;             trace("total "+total); //      trace(q[i]_cb.getSelectedItem().data == correctAnswers[i]);         }     } }

I am trying to create a quiz using combox component. I am not sure how to go about correcting the answers.

pls. let me know where I am going wrong.
a sample file at www4.ncsu.edu/~bjagann/forum/cb.zip

thnx!
texbala is offline   Reply With Quote
Old 04-18-2003, 04:03 AM   #2
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Howdy...

I saw the other thread with the same problem... Should I say this is the crossposting as well???

Same thing applies here...
ActionScript Code:
if ([b]this["q" + i + "_cb"][/b].getSelectedItem().data == correctAnswers[i])
Oh... You are not allowed to use my initial as a file name...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 04-18-2003, 04:11 AM   #3
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

thnx CyanBlue...

yeah.. it was sort of cross-posting!!

i copied out the simple step so that i will be able to get some help... in the General Help section. have a deadline to work tonight... hence the neediness

i always gets stuck in this path (i know i am asking the same kinda problem the second time in this forum)

thnx!! a long night to go!!
texbala is offline   Reply With Quote
Old 04-18-2003, 04:26 AM   #4
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Sure... Holler me when you need me... Don't know how long I am going to be up tonight, but I'll be around...

That pathing stuff... Yeah... That's the pain... But you gotta get over it cuz there are bigger waves of pain coming to you... Lots of mountains to climb to get us one step ahead...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 04-18-2003, 04:39 AM   #5
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

thnx CyanBlue..

am stuck here....
am creating a quiz... with combox box values.. to be checked...

the last part of the quiz.. to check whether correct or not..
i need to put a correct mark/ incorrect mark at the side when btn_check button is pressed.

ActionScript Code:
btn_check.onPress = function() {     var correctAnswers = new Array(1, 2, 3, 1, 2, 3,1, 2);     var userAnswers = new Array(q1_cb.getValue(), q2_cb.getValue(), q3_cb.getValue(), q4_cb.getValue(), q5_cb.getValue(), q6_cb.getValue(), q7_cb.getValue(), q8_cb.getValue());     for (i=0; i<=8; i++) {         if (userAnswers[i] == correctAnswers[i]) {             this["holder"+i].attachMovie("tick", "tick"+i, i);             trace(this["holder"+i]);             trace("userAnswers "+ userAnswers[i] + " correctAnswer "+ correctAnswers[i]);             total++             trace(total);         } else {             this["holder"+i].attachMovie("wrong", "wrong"+i, i);         }     } };

let me know, if u need the file..

"holder" - is an empty mc
"tick" is the linkage to the mc in the library
"wrong" - dido


thnx

Last edited by texbala; 04-18-2003 at 04:43 AM.
texbala is offline   Reply With Quote
Old 04-18-2003, 04:45 AM   #6
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Yeah... File would be easier... I thought that I was going to add that part in your last file, but I see that it is different one... Let me know the URL...

Oh... Forgot to ask one more thing... What is the thing you want me to check???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 04-18-2003, 04:50 AM   #7
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

http://www4.ncsu.edu/~bjagann/forum/forum_qu.zip

thnx!!
texbala is offline   Reply With Quote
Old 04-18-2003, 05:06 AM   #8
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

also.. i need to add two possible answers for the second/ third question

the file that i had sent... doesn't have "tick" and "wrong"

also.. i need to make the holder either have correct/ wrong mc's.
texbala is offline   Reply With Quote
Old 04-18-2003, 05:15 AM   #9
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Um... Let's not go that fast... Check out the file first and see if I am getting it right... I don't know what you want me to fix cuz your attachMovie() function worked just fine to me... Hm... Let me know first...
Attached Files
File Type: zip forum.zip (77.7 KB, 597 views)
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 04-18-2003, 05:23 AM   #10
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

for me.. the attachMovie didn't work.. that was the only problem when i posted it...

the next problem.. how can i add two answers to be correct.

also.. did u check to see whether the right answers have the blue and the wrong answers have the red... for me.. sometimes it doens't match... ?? am i missing something??
texbala is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:36 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.