views:

522

answers:

2

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?

+2  A: 

Hi, 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"&gt;
 <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"&gt;
 <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.

radekg
No, you don't it works without embedded fonts.
Kekoa
A: 

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?

Kekoa
No, it doesn't, please check my edited reply.
radekg
Clarification, the textbox in radiobutton control is a dynamic text box. To apply alpha to dynamic text box you have to embed the font.http://www.actionscript.org/forums/archive/index.php3/t-310.htmland generally:http://www.google.com/search?q=flash+dynamic+text+alpha
radekg