AS3 Error: '1172: Definition fl.controls:Button could not be found.'

柔情痞子 提交于 2019-12-05 12:53:42

You are using the wrong type of button. As you describe it, you want

flash.display.SimpleButton

fl.controls.Button is a Button component, not a button defined in the library. Make sense? Try importing flash.display.SimpleButton and setting _button to be a SimpleButton instead.

Matt Dales

You need to go to the "Components" window and drag a "Button" onto your "Library" window.

To use the component, simply import it using the import fl.controls.Button; instruction. You can now use the "Button" with its label and so on.

Matt Dales - is right. I just now had the exact problem. The "Button" fooled me. In ctrl+f7 = components panel, I looked in the Video group and tried a button from there. Doesn't work as a "Button". Look in the "User Interface" group. Get the "Button" from there and drag into the Library. Then fl.controls.Button and Button() work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!