PDA

View Full Version : Problems with FCheckBox.getEnabled


kroma
03-21-2005, 05:13 PM
Hello again... :)

I have a function for checking the value of a series of 17 checkboxes... (choice0, choice1, choice2 etc. through to choice16).

I want to check to see if they are selected or deselected so I have started to write the following function:

function checkboxes()
{
for (i = 0; i < 17; i++)
{
isboxchecked = this["choice"+i].getEnabled();
trace(isboxchecked);
}
}
However this simply returns the word "undefined" 17 times in the trace window!

If I replace the word getEnabled, however, with getLabel - the trace window happily displays the text associated with each of the checkboxes with no problems at all...

So can anyone tell me what is wrong with the way I am using getEnabled ?

Thanks alot!

Simon.

Xeef
03-21-2005, 05:22 PM
Hmmm

what's an "FCheckBox" ? is this some addon ?
where can i get it to test ?
more info PLS

kroma
03-21-2005, 06:17 PM
FCheckBox (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary203.html)

FCheckBox.getEnabled (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary204.html)

kroma
03-21-2005, 06:35 PM
Hmm... I just found this page which I presume is comparing V1 and V2 of ActionScript:

http://www.mediasparkles.com/v1vsv2.html

So I tried using 'enabled' instead of 'getEnabled()' and now at least I am getting some results, however all 17 of them are apparently 'true' - even when none of them are selected!

kroma
03-21-2005, 06:51 PM
Okay never mind, I figured it out now... needed to use .selected instead of getEnabled() or enabled...

function checkboxes()
{
for (i = 0; i < 17; i++)
{
if (this["choice"+i].selected) {
trace("box checked");
}

else {
trace("box not checked");
}

}
}

Xeef
03-21-2005, 07:03 PM
Hmmmmm

not sure but i think this is Mx stoff and NOT MX04

try

this["choice"+i].selected

Xeef
03-21-2005, 07:06 PM
hah to late :)

self discowered is the best

kroma
03-25-2005, 06:17 PM
hah to late :)

self discowered is the best
it is indeed! but thanks anyway for taking the time to post the answer... :)