本文介绍了什么错误:与命名空间 public 中继承的定义 flash.display:DisplayObject.mouseX 存在冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这出现在我尝试使用 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.

这篇关于什么错误:与命名空间 public 中继承的定义 flash.display:DisplayObject.mouseX 存在冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 13:40