专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Flex

点击ViewStack下子容器事件的监听,该如何解决

发布时间:2011-06-27 20:43:27 文章来源:www.iduyao.cn 采编人员:星星草
点击ViewStack下子容器事件的监听
标题有点乱,直接贴代码吧
main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:myCom="*"
layout="absolute" width="600" height="500" backgroundColor="#a5a5a5" >
<mx:ToggleButtonBar id="toggleButton" dataProvider="{control}" bottom="0" horizontalCenter="0" toggleOnClick="true" selectedIndex="0" 
height="70"/>

<mx:ViewStack id="control" width="600" height="500" >
 
<myCom:storage />
  </mx:ViewStack>
</mx:Application>

在storage.mxml中的<mx:Script>中有个function  
现在希望在main中点击storage后 这个function能够触发  
该怎么实现  
可能有点文不对题 见谅 不知道怎么去表达
对问题有什么不明白的留言
谢谢先

------解决方案--------------------
如果是写在mxml里面这样写
<myCom:storage click="onClickHandler(event)"/>
这个就是你要相应的方法
function onClickHandler(event:MouseEvent)

在as代码里面这样写
this.addEventListener(MouseEvent.CLICK, onClickHandler);
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: