apache-flexgumbo

Changing css properties for selector at runtime


I have a css that defines de skin-class for a custom component, like this :

view|PlaceHolderView {
    skin-class:ClassReference('view.skin.PlaceHolderSkin');
}

Is there a way to change that value at runtime, so that all instances of the component switch skin?


Solution

  • I found the answer to my question after a bit more digging around.

    var dec:CSSStyleDeclaration = styleManager.getStyleDeclaration('view.PlaceHolderView')
    dec.setStyle('skinClass', MyOtherSkinClass);
    styleManager.setStyleDeclaration('view.PlaceHolderView', dec, true);