views:

4666

answers:

3

You can skin a RadioButton in Flex by setting the following values in CSS:

upSkin: Embed(...); 
overSkin: Embed(...);
ownSkin: Embed(...);
disabledSkin: Embed(...);
selectedUpSkin: Embed(...);
selectedOverSkin: Embed(...);
selectedDownSkin: Embed(...);
selectedDisabledSkin: Embed(...);

But, it will still display the little circle icon inside your skin. You can change the icon by setting the following styles:

upIcon: Embed(...);
overIcon: Embed(...);
etc...

My question is, how can I set these icons to nothing? Rather than a 1x1 pixel transparent image or something? How can I give it an empty style?

Edit:

In actionscript I can do it like:

button.setStyle("icon", null);

In CSS I've tried:

icon: none;
icon: null;

But neither worked.

Accepted Answer:

Suggestions [one][1] & [two][1] both worked, but I prefer the cleaner solution of:

upIcon: ClassReference(null);

Thanks for both answers (wish I could mark both as the answer!)

[1]: http://stackoverflow.com/questions/433654/how-to-set-the-radiobutton-icon-style-to-nothing-in-css-in-flex-3#433852 one

[1]: http://stackoverflow.com/questions/433654/how-to-set-the-radiobutton-icon-style-to-nothing-in-css-in-flex-3#434540 two

+1  A: 

If its standard CSS, you can use the following. I'm assuming the styles are classes, if they're IDs replace the . with a #:

.upSkin
{
    background: none;
}

The background property can be used to set color, positioning, and repeating; if you need to specifically target just the background image use:

.upSkin
{
    background-image: none;
}
Soviut
+2  A: 

I don't think it's possible to set the skin as null in Flex CSS. In fact, some Flex component must have something set for the skin, and they will throw runtime errors if you use setStyle("skinName", null). I usually use a declaration like this when I want no skin:

RadioButton
{
    upIcon: ClassReference("mx.skins.ProgrammaticSkin");
}

The ProgrammaticSkin class displays nothing and implements IFlexDisplayObject (which is often a requirement for skins in Flex), so I think it's the best choice for when you want a blank skin.

joshtynjala
+2  A: 

Try this:

ClassReference(null);
cliff.meyers