Home » ActionScript 3.0, Flash AS 3

QUICK TIPS: set a global component style in Flash/AS3

7 October 2009 One Comment

Request: How to set a global component style in Flash / AS3?
Solution: Use StyleManager class and setComponentStyle method to set global styles

Following code sets color, size and textPadding properties to each Button Component used in your own Flash Application.

import fl.managers.StyleManager;
import fl.controls.Button
 
// Set a global textFormat for every Button Component
var tf:TextFormat= new TextFormat();
tf.color = 0x0000FF;
tf.size = 16;
StyleManager.setComponentStyle(Button, "textFormat", tf);
 
// Set a global style property for every Button Component
var styleProperty:String = "textPadding";
var value:Number = 30;
StyleManager.setComponentStyle(Button,styleProperty,value);

One Comment »

  • AS3 said:

    [...] Configurare uno stile globale per un componente in flash Categories: Senza categoria « Barcellona (s)montado… Creare componenti Flex » [...]

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.