[Flash 8]组件共用监听

      Flash 2006-3-13 15:14
Flash 8 的一些组件可以共用监听,如此在当情况适合,可提高代码效率:
--------------------
var array = [{label:1,data:1},{label:2,data:2}];
var listenerObject:Object = new Object();
listenerObject.change = function(eventObject:Object) {
trace(eventObject.target._name)
};
combobox.addEventListener("change", listenerObject);
listbox.addEventListener("change", listenerObject);
combobox.dataProvider = array;
listbox.dataProvider = array;
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}