Is there a way to add a flex skin programmatically in ActionScript? -


I have various components that are skinned through programmatic skin. The skin class references a singleton class which is used in various colors Is applied to different components. The default color in the singleton class is set on the variations of black / gray etc. I am loading in custom colors from an XML file which then loads into a singleton. I am implementing custom skin through CSS stylesheet which is included in main application MXML.

The problem is that when the SWF loads initially, the components drawn on the screen are black and do not reflect the change in the color loaded from the XML file. I have some dropdown windows The buttons that display on the click and the right colors are displayed from the XML file from those dropdowns. Therefore, the system is working correctly, but the initial diagram of the component is definitely done before the XML loading and applies to singleton.

My question is, is there a way to program an element on the skin by calling Constructor?

I have this in my CSS file:

  .pancrollbackbackground {borderscin: classference ('skins.battans.pancrollsbackger'); }   

And I am implementing the square with it:

  _app.panControls.styleName = "PanControlsBackground";   

There is no way to call:

  _app.panControls.styleName = new PanControlsBackground ();   

Or is there something for that effect? In this way, I can remove the skins loading in the CSS file and when it is ensured that the right colors are applied before displaying different colors, they can be controlled.

You can use to manipulate the style at run time. For example,

  .PanControlsBackground {/ * leave it empty * /}   

and then in some script blocks:

  Style Manager .getStyleDeclaration ("PanControlsBackground"). SetStyle ("Frontline", Skins.battans.Pancentrilsbackground);   

Therefore, this is a method of changing the skin in a programmatic way.

However, I do not have much information about how garbage collection is used on old skins. For example, how can the GC be different on this method of switching the skin when having a bunch of different CSS classes for each of your skin and switching between them? I can not really answer it

I think at least one can say that the above method will ensure that the default (or other minimum skin that you can make) is used first, the initial procedure is to the second skin Immediately provided.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -