spidermonkey
03-21-2005, 10:13 PM
I'm building a tutorial in the Flash MX (latest version) and I'm having problem with radio buttons. Ok, I haven't done much Actionscript particularly in MX. I'm a few weeks away from being sent to an Actionscript class and the books I have are really crappy. There are like a dozen examples of how to make radio buttons and all of them produce errors.
So moving right along... I'm trying to do a basic Q&A with 3 buttons like this:
What is the capital of NY?
- Boston
- Albany
- Trenton
I made these buttons by just dragging them out on to the window from the Components panel and then giving them all the group name 'rbgroupQ1'. Then I named each button instance accordingly: rbQ1, rbQ2 and rbQ3.
In my layer called 'script where I'm putting all my scripting for navigation buttons, etc., I've added this to it:
stop();
btnSubmit.addEventListener("click", mx.controls.RadioButton.addEventListener());
if (rbA2.enabled) {
trace("Correct!");
} else {
trace("Sorry, try again.");
}
When I run this though, the Output window shows:
undefined
Correct!
Am I really far off on this one? I know that in this Flash version you can drag out these components from the Learning Interactions library, but I don't want to build andentire quiz, and we're not testing students for scores on these questions. I just want to have them select a button, click on the push button and get response back.
Thanks!
So moving right along... I'm trying to do a basic Q&A with 3 buttons like this:
What is the capital of NY?
- Boston
- Albany
- Trenton
I made these buttons by just dragging them out on to the window from the Components panel and then giving them all the group name 'rbgroupQ1'. Then I named each button instance accordingly: rbQ1, rbQ2 and rbQ3.
In my layer called 'script where I'm putting all my scripting for navigation buttons, etc., I've added this to it:
stop();
btnSubmit.addEventListener("click", mx.controls.RadioButton.addEventListener());
if (rbA2.enabled) {
trace("Correct!");
} else {
trace("Sorry, try again.");
}
When I run this though, the Output window shows:
undefined
Correct!
Am I really far off on this one? I know that in this Flash version you can drag out these components from the Learning Interactions library, but I don't want to build andentire quiz, and we're not testing students for scores on these questions. I just want to have them select a button, click on the push button and get response back.
Thanks!