Adding your own custom CheckBox control icons in Flex

The following example shows how you can override the default icon in the Adobe Flex CheckBox control and replace it with a custom embedded graphic.

Full code after the jump.


<?xml version="1.0" encoding="utf-8"?>
<!-- -->
<mx:Application xmlns:mx=""

        CheckBox {
            /* Unselected icons */
            upIcon: Embed(source="assets/bullet_red.png");
            overIcon: Embed(source="assets/bullet_red.png");
            downIcon: Embed(source="assets/bullet_yellow.png");
            /* Selected icons */
            selectedUpIcon: Embed(source="assets/bullet_green.png");
            selectedOverIcon: Embed(source="assets/bullet_green.png");
            selectedDownIcon: Embed(source="assets/bullet_yellow.png");

    <mx:CheckBox id="cheezburger"
            label="I can has cheezburger?"
            fontWeight="bold" />


View source is enabled in the following example.

5 thoughts on “Adding your own custom CheckBox control icons in Flex

  1. Sorry for the lack of SWFs on the last couple posts… I’m currently in a hotel in Chicago for Adobe MAX 2007/North America. I’ll generate and posts the SWFs when I get a bit more time later in the week.

    Hope to see you all at MAX!


  2. hi,I’m a fresh,can you give me some advise to study Flex,and can you tell me how do u study Flex,thanks.

  3. Hey peterd,

    If you need help with Flex, I have an awsome example that needs attention. It is an open source Flex/AMFPHP/MySQL based task management system (like tada). I actually want to make a basecamp replaement in Flex and make it open source. I actually only published a version with project management and task management, but I am working on one that does projects, tasks, calendar and user management in the system. Tell me if your interested or at least the code will get you started.

    Stephen Weber

  4. I’ve created my own custom skin through images. I’ve got a minor problem though, the old checkboxes are still showing.

    Do you happen to know why this is happening?



    1. Nevermind, I already found my problem. It was quite stupid actually =p, instead of chaning out the icon in the css I swapped out the whole background, D’Oh.


Comments are closed.