flex 图片绑定对象,并显示图片

SimCityOnLine 2012-04-19 08:43:50
将几个图片放入数组中,(每个图片上绑定一个图片对象,保存图片的信息),然后通过数组显示图片,并且显示图片所绑定的信息
...全文
334 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
雷恩特 2012-06-21
  • 打赏
  • 举报
回复
用ArrayCollection
var arr:ArrayCollection = new ArrayCollection([
{对象:Object}
]);
zmbc48 2012-06-15
  • 打赏
  • 举报
回复
不行,数组对象错误
1067: Array 类型值的隐式强制指令的目标是非相关类型 mx.collections:ArrayCollection。
SimCityOnLine 2012-04-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
方法很多。
1、用二维数组
2、用Object
3、用xml
[/Quote]
ArrayCollection 也可以吧!
图片怎么加入集合呢?什么方式?字符串?类?

[Bindable]
[Embed(source="../WebContent/images/SCport_con.png")]
public var scport_icon_con:Class;

[Bindable]
[Embed(source="../WebContent/images/SCport.png")]
public var scport_icon:Class;

private var port:PortDTO;
private var portZ:PortDTO;
public var imgA:Image;
public var imgZ:Image;
public function inti():void{
port=new PortDTO();
port.port_name="端口A";
port.port_row="01";
port.port_column="01";
port.port_id="0101";
portZ=new PortDTO();
portZ.port_name="端口Z";
portZ.port_row="02";
portZ.port_column="02";
portZ.port_id="0202";
imgA=new Image();
imgA.source=scport_icon;
imgA.data=port;
imgZ=new Image();
imgZ.source=scport_icon;
imgZ.data=portZ;

}

//获取图片对象
[Bindable]
public var imageAC:Array=new Array[imgA,imgZ];
这样写可以吗?
xinje 2012-04-19
  • 打赏
  • 举报
回复
方法很多。
1、用二维数组
2、用Object
3、用xml

4,328

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计 Flex
社区管理员
  • Flex
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧