I’m curious how to do custom change handler functions for the UI checkbox component… like they click on a box and an object appears on the stage… they unclick it, it disappears. while i know how to do the base code that would do this (i.e. _visible property or attachmovie or whatever), i’m not sure how to have the function called in the checkbox… i have like 20 checkboxes, all which would be doing different things, and there is the change handler box in the property window of the checkbox item, but i’m not sure what the syntax is to call a function from there… do you just put call fctnName or do you just put the function name or what?
In the tutorial Creating a ListBox, I did an example of setChangeHandler. Check it out kirupa.com/developer/mx/listbox.asp\r\rpom 0]
If you have some checkboxes named ‘cat’, ‘dog’ and ‘fish’, you can try this code :
function Display(c){\r\r        if (c.getValue ()) _root.result="The Checkbox " + c.getLabel() +" is selected";\r\r        else _root.result="The Checkbox " + c.getLabel() +" is deselected";\r\r}\r\r\r\rcat.setChangeHandler("Display" );\r\rdog.setChangeHandler("Display" );\r\rfish.setChangeHandler("Display" );
pom 0]
Thanks. That did it for me. makes sense too.