MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 73

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Notice that the
fontStyle
text itself but also the text associated with the TextInput and Button components inside the
Accordion component.
Setting global styles
The global style declaration is assigned to all Flash components built with version 2 of the
Macromedia Component Architecture. The _global object has a
(
_global.style
style declaration. If you change a property's value on the global style declaration, the change is
applied to all components in your Flash document.
Caution: Some styles are set on a component class's CSSStyleDeclaration instance (for example,
the
backgroundColor
declaration takes precedence over the global style declaration when style values are determined,
setting
backgroundColor
TextInput components. For more information, see
document" on page
To change one or more properties in the global style declaration:
Make sure the document contains at least one component instance.
1.
For more information, see
Select a frame in the Timeline on which (or before which) the components appear.
2.
In the Actions panel, use code like the following to change properties on the global style
3.
declaration. You need to list only the properties whose values you want to change, as shown
here:
_global.style.setStyle("color", 0xCC6699);
_global.style.setStyle("themeColor", "haloBlue")
_global.style.setStyle("fontSize",16);
_global.style.setStyle("fontFamily" , "_serif");
Select Control > Test Movie to see the changes.
4.
Using global, custom, and class styles in the same document
If you define a style in only one place in a document, Flash uses that definition when it needs to
know a property's value. However, one Flash document can have a variety of style settings—style
properties set directly on component instances, custom style declarations, default class style
declarations, inheriting styles, and a global style declaration. In such a situation, Flash determines
the value of a property by looking for its definition in all these places in a specific order.
Flash looks for styles in the following order until a value is found:
Flash looks for a style property on the component instance.
1.
Flash looks at the
2.
assigned to it.
Flash looks for the property on a default class style declaration.
3.
setting on the Accordion component affects not only the Accordion
) that is an instance of CSSStyleDeclaration. This property acts as the global
style of the TextArea and TextInput components). Because the class style
on the global style declaration would have no effect on TextArea and
73.
"Adding components to Flash documents" on page
property of the instance to see if a custom style declaration is
styleName
style
"Using global, custom, and class styles in the same
Using styles to customize component color and text
property
44.
73

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents