读书人

Flex4中的StyleManager如何用

发布时间: 2012-11-10 10:48:50 作者: rapoo

Flex4中的StyleManager怎么用?
在Flex3.0中改变样式方法:

  var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration(".bigMargins");  newStyleDeclaration.defaultFactory = function():void  {      leftMargin = 50;      rightMargin = 50;  }  FlexGlobals.topLevelApplication.styleManager.setStyleDeclaration(".bigMargins", newStyleDeclaration, true);


还有,使用类型选择器时要记得把namespace写完整,如spark.components.Button或者mx.controls.Button,否则编译器不知道你到底要调用哪个Button,容易报出空指针。

读书人网 >flex

热点推荐