---
title: "flex Function使用"
author: "q272156430"
date: "2011-07-15T10:15:10Z"
tags: []
categories: ["编程语言"]
slug: "flex-function"
draft: false
lastmod: "2011-07-15T10:15:10Z"
id: 1125002
url: "https://xiaolele.iteye.com/blog/1125002"
---

```
ViewerContainer.addEventListener(AppEvent.DATA_CREATE_INFOWIDGET, onInfowidgetRequest);
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady));
      
       private var m_infoWidgetCallback:Function;
       private function onInfowidgetRequest(event:AppEvent){
             m_infoWidgetCallback =  event.callback;//m_infoWidgetCallback 值为这个函数  infoReady
          m_infoWidgetCallback(new AppEvent(AppEvent.DATA_CREATE_INFOWIDGET, _infoData));//去执行其它类的这个infoRedy函数
           }
     
    private function infoReady(event:AppEvent){...};
```