This content has been marked as final. Show 4 replies
You just have to turn them all off every time one is selected.
Say you have ten checkboxes and their instance name is box0 thru box9
You can put code on the checkbox instance that turns off all of the rest or create a function that each ones calls that does the work for you.
The function on the root is the way I would do it so here's how that would go.
_root.["box" + i].setValue( false);
then in the checkbox instance you would call the function
anyway, the moral of the story is that everytime one gets checked turn them all off then turn back on the one you want.
Hope it helps
Thanks for the reply.
That would be good for the 'acting as a radioGroup' part of it.
The problems is, how to change the status of the checkbox that inside a menu item.
I load the static values of the menu item's checkboxes via XML like this:
<menuitem label="Facilities" instanceName="facility_open" type="check" selected="false"/>
Now to change the check to selected=false preferably without reloading the original XML data (thus reloading the menu).
Any idear about this?
Finally something i think i can answer, i was messing around with this stuff aswell. I wanted to beable to destroy the object through multiple interfaces and one of them included directly from the menu as a click off function for the check menu item. Now this is what i found out, you don't need to change the actual xml, just use in-flash functions for the menu, like this:
var Menu_item = _root.Your_menu.getMenuItemAt(2); //starts at 0 and goes on, remember seperators count aswell.
_root.Your_menu.setMenuItemSelected(Menu_item, false); //the last true false = checked and not checked...
Now an important note is that when using this method you need to re*get the handle on the menu_item, which is done first in my code example. Also to check if the item is checked i simply used boolean logic, everytime the button was checked, set the variable from the first to the second thing, at start its false, so do like this:
if(your_boolean == false)
your_boolean = true;
your_boolean = false;
Hope this helps, if it was way off, sorry 'bout that.
That did the trick. A combination of efforts well appreciated.