-
Flex4 通过反射MXML,获取MXML组件中的button信息,获取的信息为null5
想通过Flex反射mxml获取组件中的自定义button信息。但是获取的button为null,但是可以获取public的属性信息。代码如下:
var _PurviewButtons:Boolean = true;
try {
trace("实例化:"+item.@type);
var _PurviewRefrence:Class = getDefinitionByName(item.@type) as Class;
}
catch(e:ReferenceError) {
_PurviewButtons = false;
trace(e);
//continue;
}
if(_PurviewButtons){
var _PurviewInstance:UIComponent = new _PurviewRefrence() as UIComponent;
var propertiesList:XMLList = describeType(_PurviewInstance).accessor.(@type=="com.fms.xx.module::PurviewButton");
for each(var propertyInfoa:XML in propertiesList){
var propertyNamea:String = propertyInfoa.@name;
trace("propertyNamea "+propertyNamea +" "+_PurviewInstance[propertyNamea]);
}
var _PurviewInstanceInfo:XML=describeType(_PurviewInstance);
var _properties:XMLList=_PurviewInstanceInfo..accessor.(@type=="com.fms.xx.module::PurviewButton");
trace("_properties:"+_properties.toXMLString());
//遍历按钮
for each(var _propertyInfo:XML in _properties){
var _propertyName:String = _propertyInfo.@name;//此处取出的为id
if(_PurviewInstance[_propertyName]!=null){
var _btnLabel:String = Button(_PurviewInstance[_propertyName]).label; //显示出来的按钮名称
//创建叶子节点--按钮节点
var _menuButton:Object = new Object();
_menuButton.id = _propertyName;
_menuButton.label = _btnLabel;
_menuButton.selected = false;
_menuButton.value = _propertyName;
//把按钮节点放入菜单项节点的子节点数组中
menuLeaf.children.push(_menuButton);
}else{
trace("按钮名称:"+_propertyName+" 为null。。。");
}
} //end of for
}
在mxml上端已经声明需要反射的mxml对象。
这个问题如何解决2014年3月12日 09:06
目前还没有答案
相关推荐
pdf格式的flex的mxml语法,适合想学习flex的新手
关于Flex4不生成mxml对应的html文件的解决方法,有时候mxml文件编译时没有生成对应的swf文件和html文件。
MXML语法.MXML flexview actionscript
Flex中利用HTTPService MXML标签(tag)将XML转化为对象(objects)
如果你的flex插件出现mxml无法打开的问题,请下载此文件,同时参考:http://www.tekool.net/blog/2008/06/28/flex-builder-3-plugin-dont-work-with-eclipse-34/或者:...
flex+flash+mxml = 绚丽相册实现 简单精美欢迎下载
flex -MXML语法,介绍flex 的 mxml的基本语法构成,适合一般学习者使用
flex4 选择树组件。可以直接使用组件包。在Test.mxml里面有使用的测试。
实现了计算器的加减乘除开根号和幂操作。没有去实现AS和MXML分离。 想研究的同学下载吧。。将文件解压后导入到FB 3.0 中
Flex 与 Flash 在我们的印象里 Flash ...同样地,Flex 程序中的 MXML 和 ActionScript 代码首先全部被转换为 ActionScript 然后编译为 SWF 文件。当你把 SWF 文件部署到服务器上时,使用者可以从服务器获取到这个程序。
flex入门教程,主要介绍了mxml和ActionScript的简单应用,适合初学者,高手就没必要下载啦
flex4+arcgis10的例子,和官网上的一样。。。方便大家研究,谢谢 。。。。。。。。。。。。。。。。。。。。。。
Classes Class Description OLAPAttribute The OLAPAttribute class represents a single attribute of an OLAPDimension. OLAPAxisPosition The OLAPAxisPosition class represents a position along the axis ...
About MXML programming files and Flex usage.
flex使用容器和MXML样式.pdf格式的 英文的哦
一个上课用的ppt文档,更容易让你对mxml更为的了解。。
NULL 博文链接:https://liujianshiwo.iteye.com/blog/624512
NULL 博文链接:https://yangyangmyself.iteye.com/blog/2116383
flex把html页面作为类似iframe的样子的组件完全的嵌入到mxml中去。
MXML语言是专门用于Flex程序中,描述界面表现的一中XML标记语言。我们可以用它来管理程序的整体布局,控制组件的样式和外观,也可以构建非可视化的对象,比如XML数据、与服务器端通信的WebService、组件的数据源等。