Flex动态类属性添加及访问
2013-04-10 15:30
232 查看
动态类作用主要是根据自己的需要添加自己想要的属性,其中Object就是一个动态类。
下面为动态类属性添加的两种方法:
下面为动态类属性添加的两种方法:
internal function testObject():void{ var student:Object = new Object(); student.name = "小王"; student.age = 20; student.type = "本科"; for(var prop:String in student){ trace(prop+":"+student[prop]); } }
internal function testObject():void{ var student:Object = new Object(); student["name"] = "小王"; student["age"] = 20; student["type"] = "本科"; for each(var prop:String in student){ trace(prop); } }
相关文章推荐
- flex添加对象属性
- 利用jQuery来动态添加属性 jQuery.ajax $.post $.load 序列化表单
- js里面怎么动态的为对象添加属性
- [集成IronPython] 使CLR对象对动态语言更友好(一)—— 支持运行时添加删除属性
- 通过运行时动态给OC分类添加属性
- 转: javascript动态添加、修改、删除对象的属性和方法
- 函数动态添加实例属性
- js动态给对象添加属性和值
- Struts2访问或者添加request等属性
- Struts2.0学习笔记 --- 访问或添加几个属性的三种方式
- jQuery获取Select选中的Text和Value,根据Value值动态添加属性等
- JS动态创建表格,动态设置属性,动态添加事件
- C# 类动态添加属性、方法(Z)
- xml 操作(动态添加 property属性 其他节点同理)
- 第六种方式,python使用cached_property缓存装饰器和自定义cached_class_property装饰器,动态添加类属性(三),selnium webdriver类无限实例化控制成单浏览器。
- python动态添加属性和方法
- 给IOS对象添加动态属性
- 【WPF】C#代码动态添加控件的Margin属性
- 玩转动态编译 - 高级篇:一,IL访问静态属性和字段
- 动态添加标签属性