什么是错误:存在着继承定义flash.display使用冲突:DisplayObject.mouseX在公共空间?冲突、定义、错误、存在

2023-09-08 15:33:31 作者:昨夜西风

这似乎为我试图用MouseEvent来移动对象。 我放在公共类mouseX和mouseY的变量。我也做了同样的方向X和Y但对于那些没有错误消息。

This appeared as I was trying to use a mouseEvent to move an object. I placed the variables for mouseX and mouseY in the public class. I did the same for direction X and Y but there was no error message for those.

推荐答案

如果您要添加的 mouseX 来被扩展类的DisplayObject 类型(如果它是任何一种比它Flex组件),你已经与从类型名称的变量。作为一个固定的名字您的变量别的东西,例如。 myMouseX 。如果你不知道究竟我正在与有关扩展类,检查的面向对象的编程在ActionScript 。

If the class you are adding the mouseX to is extending the DisplayObject type (and if it's any kind of Flex component than it does), you already have a variable with that name from that type. As a fix name your variable something else eg. myMouseX. If you don't know what exactly I'm taking about with extending classes, check the tutorial on Object-oriented programming in ActionScript.