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;
--------------------
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;
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}