AS3 - 调度事件"变"对于组合框 [英] AS3 - Dispatch Event "change" for ComboBox

查看:147
本文介绍了AS3 - 调度事件"变"对于组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的ComboBox组件,我想手动调度change事件。这是怎么做的?

  //当用户更改选择急件
comboType.addEventListener(变,cbListenerDialogue);

//不手动调度
comboType.dispatchEvent(变);
comboType.dispatchEvent(新的事件(变));
 

解决方案

您用于调度的字符串值必须匹配什么在Flash中已定义。

这应该向伎俩。

comboType.dispatchEvent(新事件(Event.CHANGE,真));

另外: AS3文本框更改事件不触发

I'm using the combobox component and I want to manually dispatch the "change" event. How is this done?

// Dispatches when user changes selection
comboType.addEventListener("change",cbListenerDialogue);

// Does not manually dispatch
comboType.dispatchEvent("change"); 
comboType.dispatchEvent(new Event("change"));

解决方案

The string value you use for the dispatch has to match what's already defined in Flash.

This should to the trick.

comboType.dispatchEvent(new Event(Event.CHANGE, true));

Also: AS3 Textbox Change Event Not Firing

这篇关于AS3 - 调度事件"变"对于组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆