Flex3 弹出窗口 相应事件传参的问题 20
首先我的主文档scr.mxml里面有个<mx:HorizontalListid="horizontallist"dataProvider="{arr1}"labelFie...
首先 我的主文档scr.mxml里面有个
<mx:HorizontalList id="horizontallist" dataProvider="{arr1}" labelField="label" iconField="thumbnailImage" itemRenderer="stomItemRenderer">
</mx:HorizontalList>
然后 arr1是
<mx:Array id="arr1">
<mx:Object label="大嘴巴-爱不爱我" thumbnailImage="img/new img/abaw.jpg"/>
<mx:Object label="王心凌-Happy Loving" thumbnailImage="img/new img/happy loving.jpg"/>
</mx:Array>
接着stomItemRenderer.mxml是和scr.mxml在同一目录下的 stomItemRenderer.mxml内容是
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center">
<mx:Image source="{data.thumbnailImage}"/>
<mx:Label text="{data.label}"/>
<mx:click>
<![CDATA[
_img1(event)
]]>
</mx:click>
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager
import mx.containers.TitleWindow
import gtnew.newgt;
private var tc:newgt
private function _img1(evt:MouseEvent):void {
tc = newgt(PopUpManager.createPopUp( this, newgt , true));
PopUpManager.centerPopUp(tc)
tc.x=250
tc.y=100
}
]]>
</mx:Script>
</mx:VBox>
最后弹出的窗口 newgt.mxml的内容是
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" title="" fontSize="12" showCloseButton="true" width="500" height="500">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager
]]>
</mx:Script>
<mx:close>
<![CDATA[
PopUpManager.removePopUp(this)
]]>
</mx:close>
</mx:TitleWindow>
现在弹出窗口做到了 我现在希望弹出的这个窗口newgt的title正好是我在scr.mxml中的HorizontalList中的图片对应的名字 比如我现在单击大嘴巴-爱不爱我 我就希望弹出的窗口的title也为大嘴巴-爱不爱我 怎么做到啊? 展开
<mx:HorizontalList id="horizontallist" dataProvider="{arr1}" labelField="label" iconField="thumbnailImage" itemRenderer="stomItemRenderer">
</mx:HorizontalList>
然后 arr1是
<mx:Array id="arr1">
<mx:Object label="大嘴巴-爱不爱我" thumbnailImage="img/new img/abaw.jpg"/>
<mx:Object label="王心凌-Happy Loving" thumbnailImage="img/new img/happy loving.jpg"/>
</mx:Array>
接着stomItemRenderer.mxml是和scr.mxml在同一目录下的 stomItemRenderer.mxml内容是
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center">
<mx:Image source="{data.thumbnailImage}"/>
<mx:Label text="{data.label}"/>
<mx:click>
<![CDATA[
_img1(event)
]]>
</mx:click>
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager
import mx.containers.TitleWindow
import gtnew.newgt;
private var tc:newgt
private function _img1(evt:MouseEvent):void {
tc = newgt(PopUpManager.createPopUp( this, newgt , true));
PopUpManager.centerPopUp(tc)
tc.x=250
tc.y=100
}
]]>
</mx:Script>
</mx:VBox>
最后弹出的窗口 newgt.mxml的内容是
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" title="" fontSize="12" showCloseButton="true" width="500" height="500">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager
]]>
</mx:Script>
<mx:close>
<![CDATA[
PopUpManager.removePopUp(this)
]]>
</mx:close>
</mx:TitleWindow>
现在弹出窗口做到了 我现在希望弹出的这个窗口newgt的title正好是我在scr.mxml中的HorizontalList中的图片对应的名字 比如我现在单击大嘴巴-爱不爱我 我就希望弹出的窗口的title也为大嘴巴-爱不爱我 怎么做到啊? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询