简体   繁体   English

闪光灯按钮完全没有反应

[英]Flash button not reacting at all

I'm making a game in Flash for school. 我正在Flash中为学校制作游戏。 I have a few dialog boxes that work just fine! 我有几个工作正常的对话框! Now I need a bigger one with more buttons and with the same code, I can't even get a trace reaction... 现在,我需要一个更大的按钮,更多的按钮和相同的代码,我什至无法获得跟踪反应...

My code: 我的代码:

On the button itself: 在按钮本身上:

okButton.addEventListener(MouseEvent.CLICK,MovieClip(parent).clickMyButton);

In the AS file: 在AS文件中:

public function clickMyButton(event:MouseEvent) {
trace("Halloooo");
}

Another question: 另一个问题:

How can I close (remove from stage) a child dialog box (movie clip) 如何关闭(从舞台上删除)子对话框(电影剪辑)

Question answered: 回答的问题:

I had a problem with and endless loop, that's why the button wasn't working! 我有一个无限循环的问题,这就是为什么按钮不起作用的原因!

If you are using AS3 its possible there is another movieclip ontop of the button and you can't click through. 如果您使用的是AS3,则按钮上方还有另一个动画片段,并且无法单击。 Also try MouseEvent.MOUSE_DOWN instead. 也可以尝试使用MouseEvent.MOUSE_DOWN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM