问题描述
我试图使用ComboBox组件为Flash。我无法改变事件触发。我的code是Adobe网站(下面的链接)的pretty的多少直。这个盒子被填充,但改变值不会产生任何跟踪输出。我究竟做错了什么?谢谢
<一个href="http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00002149.html#3138459" rel="nofollow">http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00002149.html#3138459
myCombo.addItem(HI1,了hi5);
myCombo.addItem(H2,hi6);
myCombo.addItem(HI3,hi7);
myCombo.addItem(H4,的Hi8);
VAR形式=新的对象();
form.change =功能(是eventObj){
跟踪(值改为+ eventObj.target.value);
}
myCombo.addEventListener(变,表);
我贴你的code到AS2的项目和它的工作如预期的我。没有其他的输出?尝试添加跟踪前后的addEventListener以确保它获取调用。请尝试使用一个名称不是形式为对象等。尝试在调试运行,并设置一个断点,在变化的功能。
I'm trying to use the combobox component for Flash. I can't get the change event to fire. My code is pretty much straight of of the adobe site (link below). The box gets populated but changing the value produces no trace output. What am I doing wrong? Thanks
myCombo.addItem("hi1", "hi5");
myCombo.addItem("h2", "hi6");
myCombo.addItem("hi3", "hi7");
myCombo.addItem("h4", "hi8");
var form = new Object();
form.change = function(eventObj){
trace("Value changed to " + eventObj.target.value);
}
myCombo.addEventListener("change", form);
I pasted your code into an AS2 project and it worked as expected for me. No other output? Try adding a trace before and after the addEventListener to make sure it's getting called. Try using a name other than form for your object. Try running it in debug and set a breakpoint in the change function.
这篇关于闪存/ ACTIONSCRIPT2 - 不能获得组合框&QUOT;变&QUOT;触发事件,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!