Groups | Blog | Home
all groups > flash actionscript > september 2006 >

flash actionscript : Masking over V2 components


Jeff247
9/25/2006 7:09:09 PM
Apparently, when you apply a mask over a movieClip containing V2 components
(ComboBox, RadioButton, TextInput, for example), the text is not rendered. I
knoe that embedding the fonts of a text box will work ... but how do I embed
the fonts of the components? Or is this a known problem ... :frown;
TimSymons
9/25/2006 7:16:39 PM
You have to use the styles for the components to embed the fonts.

This was taken from the help docs:

import mx.controls.Alert;
_global.styles.Alert.setStyle("color", 0x000099);
Alert.show("This is a test alert", "Title");

To embed the font, you would use:

import mx.controls.Alert;
_global.styles.Alert.setStyle("embedFonts", true);
Alert.show("This is a test alert", "Title");

When you look under the Help Docs, look under the sections titled:

Using styles with the .....

It will show you how to apply the style changes globally to all components or
just to the one you are working with.

Tim
Jeff247
9/25/2006 8:14:06 PM
Thanks for the tip ... works great for TextInput and ComboBox ... but not for Button and RadioButton.

Any clues?

Thanks --
TimSymons
9/26/2006 12:17:41 AM
You use the same technique for them too. Here is a quote from the help docs
that might be part of the problem.

This is for "embedFonts" style.

"A Boolean value that indicates whether the font specified in fontFamily is an
embedded font. This style must be set to true if fontFamily refers to an
embedded font. Otherwise, the embedded font is not used. If this style is set
to true and fontFamily does not refer to an embedded font, no text is
displayed. The default value is false."

Basically, the font you refer to has to be embedded in the Flash document,
otherwise it won't work like you expect.

Tim
Jeff247
9/26/2006 12:28:30 AM
I've been trying various combinations of that for several hours now ... it
should be :

_global.styles.RadioButton.setStyle("fontFamily", "arial");
_global.styles.RadioButton.setStyle("embedFonts", true);

... but the label text still shows up blank. A dirty workaround is to paste
static text boxes over where the labels should be ... which is what I did.

Thanks for the help ... I appreciate it.

--Jeff
TimSymons
9/26/2006 3:17:37 PM
So, just so I am certain that I understand. You have gone to the Library panel,
right-clicked, chosen New Font, select the Arial font. (Note that Flash will
treat Bold and Italic versions as separate fonts). The selected your new font
from the Library, right-clicked on it and set the Linkage name of the Font to
"arial". Correct?

If you have not done that, then it will not work. At least, I never could get
it to work without doing that.

Tim
Jeff247
9/26/2006 5:10:19 PM
Tried that ... still no dice. The text components (TextInput, TextArea) and
ComboBox seem to work OK. The button components (Button, RadioButton) are the
ones that don't display the text.

I don't want to spend too much more time on this, as my kludge seems to do the
trick.

Thanks --

--Jeff
TimSymons
9/26/2006 5:51:50 PM
OK. Sorry I couldn't be more help.

Good luck on your project.

AddThis Social Bookmark Button