首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

Flex4中的StyleManager如何用

2012-11-10 
Flex4中的StyleManager怎么用?在Flex3.0中改变样式方法:var newStyleDeclaration:CSSStyleDeclaration n

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,容易报出空指针。

热点排行