# Flash UI Component: Checkbox - change handler question

**URL:** https://forum.kirupa.com/t/flash-ui-component-checkbox-change-handler-question/1734
**Category:** flash
**Created:** [June 3, 2002, 4:38pm UTC](https://forum.kirupa.com/t/flash-ui-component-checkbox-change-handler-question/1734 "2002-06-03T16:38:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 3, 2002, 4:38pm UTC](https://forum.kirupa.com/t/flash-ui-component-checkbox-change-handler-question/1734/1 "2002-06-03T16:38:56Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 3, 2002, 6:45pm UTC](https://forum.kirupa.com/t/flash-ui-component-checkbox-change-handler-question/1734/2 "2002-06-03T18:45:54Z")

</div>

In the tutorial Creating a ListBox, I did an example of setChangeHandler. Check it out [kirupa.com/developer/mx/listbox.asp](http://kirupa.com/developer/mx/listbox.asp)\r\rpom 0]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 3, 2002, 7:04pm UTC](https://forum.kirupa.com/t/flash-ui-component-checkbox-change-handler-question/1734/3 "2002-06-03T19:04:38Z")

</div>

If you have some checkboxes named ‘cat’, ‘dog’ and ‘fish’, you can try this code :

```auto
 function Display(c){\r\r&nbsp &nbsp &nbsp &nbsp if (c.getValue ()) _root.result="The Checkbox " + c.getLabel() +" is selected";\r\r&nbsp &nbsp &nbsp &nbsp 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]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 3, 2002, 7:10pm UTC](https://forum.kirupa.com/t/flash-ui-component-checkbox-change-handler-question/1734/4 "2002-06-03T19:10:16Z")

</div>

Thanks. That did it for me. makes sense too. 🙂
