4,327
社区成员




<devices>
<item location="" model="2010" device_id="d.test.0011" type="pc" memo="" owner_id="18900013399"/>
<item location="" model="2010" device_id="d.test.shennun1" type="pc" memo="" owner_id="18900013399"/>
<item location="" model="tv2010" device_id="d.test.devie_001" type="tv" memo="" owner_id="18900013399"/>
<item location="" model="igrs" device_id="d.test.fanjx1" type="stb" memo="" owner_id="18900013399"/>
<item location="" model="" device_id="d.test.fanjx3" type="pc" memo="" owner_id="18900013399"/>
<item location="" model="pc" device_id="d.test.pc.fanjx1" type="pc" memo="" owner_id="18900013399"/>
<item location="" model="pc" device_id="d.test.pc.fanjx3" type="pc" memo="" owner_id="18900013399"/>
<item location="" model="SS200-GW" device_id="d.test.ss200-gw.fanjx1" type="stb" memo="" owner_id="18900013399"/>
<item location="" model="stb" device_id="d.test.stb.fanjx1" type="stb" memo="" owner_id="18900013399"/>
<item location="" model="tv" device_id="d.test.tv.fanjx1" type="pc" memo="" owner_id="18900013399"/>
<item location="" model="zteiptv" device_id="d.test.zteiptv.shennun1" type="stb" memo="" owner_id="18900013399"/>
<item location="" model="magictouch" device_id="dd8adec4de14d3f01d21a7ebaf2fb82a" type="magictouch" memo="memo_test" owner_id="test2017"/>
</devices>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.listClasses.ListBaseContentHolder;
private function init():void{
rightClick();
}
//右键的操作
[Bindable]
public var cm:ContextMenu = null;
private function rightClick():void{
cm = new ContextMenu();
var xz:ContextMenuItem = new ContextMenuItem("右键复制",true);
cm.hideBuiltInItems(); // 隐藏一些内建的鼠标右键菜单项
xz.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,onset);
cm.customItems.push(xz);
cm.addEventListener(ContextMenuEvent.MENU_SELECT,onselect);
//this.contextMenu = cc;
}
public function onset(evt:ContextMenuEvent):void{
Alert.show((deviceList.getChildAt(0) as ListBaseContentHolder).toString());//在这里怎样取到linkbutton的Label值
}
private var rightSelect:Number;
public function onselect(event:ContextMenuEvent):void{
deviceList.selectedIndex = rightSelect;
}
]]>
</mx:Script>
<mx:Model id="res" source="states.xml"/>
<mx:Canvas id="main" width="100%" height="100%" backgroundAlpha="#ffffff">
<mx:List height="400" left="233.5" right="433.5" bottom="69" id="deviceList"
contextMenu="{cm}" itemRollOver="rightSelect = event.rowIndex">
<mx:itemRenderer>
<mx:Component>
<mx:Canvas>
<mx:Image styleName="tempSource" source="assets/images/pc.jpg" />
<mx:LinkButton x="35" height="35" label="{data.device_id}" />
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>
</mx:List>
</mx:Canvas>
</mx:Application>