Question

I'm trying set the alpha to 50% on some radiobuttons in AS3. The problem is that the radiobutton labels won't change.

Anyone know how to fix this?

Was it helpful?

Solution

you have to use embedded fonts for your labels. As the documentation states:

  • Client environment does not need the font to be installed.
  • Embedded fonts are anti-aliased, which means that their edges are smoothed for easier readability. This is especially apparent when the text size is large.
  • Embedded fonts can be partially or fully transparent.
  • Embedded fonts can be rotated.
  • Embedded fonts provide smoother playback when zooming.
  • Text appears exactly as you expect when you use embedded fonts.
  • When you embed a font, you can use the advanced anti-aliasing information that provides clear, high-quality text rendering in SWF files. Using advanced anti-aliasing greatly improves the readability of text, particularly when it is rendered at smaller font sizes. For more information about advanced anti-aliasing, see Using advanced anti-aliasing.

http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_04.html#133099

Hope this helps.

Edit

In reply to Kekoa:

This sample makes radio control almost invisible but the label is not affected by alpha change:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:RadioButton label="Some label here" alpha=".1" />
</mx:WindowedApplication>

And with embedded font (make sure you have assets/arial.ttf):

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Style>
        @font-face {
            src: url("assets/arial.ttf");
            fontFamily: Arial;
            fontStyle: normal;
            fontWeight: normal;
        }
        .myClass {
            fontFamily: Arial;
        }
    </mx:Style>
    <mx:RadioButton label="Some label here" alpha=".1" />
</mx:WindowedApplication>

This one works fine.

OTHER TIPS

I just created an empty movie and drug a RadioButton component on stage, gave it an instance name and in the actions set the .alpha to .5.

It works.

If you are not using RadioButtons? Or are they separate from your label?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top