View comments | RSS feed

UIObject.setStyle()

Availability

Flash Player 6 (6.0 79.0).

Edition

Flash MX 2004.

Usage

componentInstance.setStyle(propertyName, value)

Parameters

propertyName A string indicating the name of the style property (for example, "fontWeight", "borderStyle", and so on).

value The value of the property. If the value is a string, it must be enclosed in quotation marks.

Returns

A UIObject object that is an instance of the specified class.

Description

Method; sets the style property on the style declaration or object. If the style property is an inheriting style, the children of the object are notified of the new value.

For a list of the styles supported by each component, see individual component entries. For example, Button component styles are listed in "Using styles with the Button component" under "Button component."

Example

The following code sets the fontWeight style property of the check box instance cb to bold:

cb.setStyle("fontWeight", "bold");

Comments


mmtechwriter said on Mar 6, 2005 at 6:29 PM :
sobluesky,
This page should help:
"Setting custom styles for groups of components"
http://livedocs.macromedia.com/flash/mx2004/main_7_2/00002032.html
mmtechwriter said on Mar 7, 2005 at 1:34 PM :
Components inherit the setStyle() method from the UIObject class. Supported styles vary depending on the component. Each component has a different set of styles you can set. For example, if you look at "Customizing the TextArea component" (here http://livedocs.macromedia.com/flash/mx2004/main_7_2/00002833.html) you'll see a table of styles, like "fontWeight" listed.
No screen name said on Apr 17, 2005 at 11:17 AM :
Why aren't the supported styles and the exact way to use them not mentioned or better explained?

Is it also possible to set the Background of an UIObject to transparent?
djtechwriter said on Apr 18, 2005 at 2:42 PM :
Transparent background color is not supported. As mentioned above, please read the "Customizing" section for each individual component to see the style properties you can set for each component. Each component has a different set of styles you can set, depending on the component design and the current theme.
jepo said on May 5, 2005 at 10:36 AM :
>> MM documentation should mention this as a 'best practice'...

We already have recommendations for improving performance when using setStyle. You can refer to this page here in our Best Practices document:

http://livedocs.macromedia.com/flash/mx2004/main_7_2/00000876.html

Refer to the section called "Optimizing styles and performance", which gives several ways depending on whether you want to style all components globally or even individually. We explain that this is the most processor-intensive calls in the component framework.

Jen.
jepo said on Jun 7, 2005 at 12:49 PM :
Thank you for your comments. This site is for documentation feedback only. Some comments with general questions about how to use components, bug reports, or feature requests for the Flash product, have been removed. Please use the Flash webforums for questions about how to use components: http://webforums.macromedia.com/flash. Please use this form for feature requests or suspected bugs: www.macromedia.com/support/email/wishform/.
No screen name said on Jul 14, 2005 at 6:53 AM :
E' possibile sapere quali sono tutte le proprietà che setStyle() può modificate? e come!?
per esempio colore di sfondo, le proprità della scrollbar ecc..
grazie
mediates said on Sep 19, 2005 at 2:28 PM :
i'm not <font color=red>sure</font> <img src=test.gif>

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00002953.html