Flash Pro CS5,编辑ActionScript3.0这两天突然出现了1119: 访问可能未定义的属性 MOUSE_DOWN问题怎么办? 90
DrawingApp.as,13行1119:访问可能未定义的属性MOUSE_DOWN(通过static类型Class引用)。有些类我之前测试是没有错误的,现在测试就出现了...
DrawingApp.as,13 行 1119: 访问可能未定义的属性 MOUSE_DOWN (通过 static 类型 Class 引用)。
有些类我之前测试是没有错误的,现在测试就出现了以上错误……
这两天,我删除了D盘目录里的一个有关flash的txt文件,还修复了Host,就没有别的敏感操作了
软件也完全卸载然后 重新安装了,
我彻底没辙了,求助啊~~~~~~~~
以下是原码:
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
public class DrawingApp extends Sprite {
public function DrawingApp() {
init()// constructor code
}
private function init():void {
graphics.lineStyle(1);
stage.addEventListener(MouseEvent.MOUSE_DOWN,onMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP,onMouseUp);
}
private function onMouseDown(event:MouseEvent):void {
graphics.moveTo(mouseX,mouseY);
stage.addEventListener(MouseEvent.MOUSE_MOVE,onMouseMove);
}
private function onMouseUp(event:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE,onMouseMove);
}
private function onMouseMove(event:MouseEvent):void{
graphics.lineTo(mouseX,mouseY);
}
}
}
但凡是包含MouseEvent的,都出错了,无一例外
最新尝试如下:
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
public class DrawingApp extends Sprite {
public function DrawingApp() {
init()// constructor code
}
private function init():void {
this.graphics.lineStyle(1);
stage.addEventListener(flash.events.MouseEvent.MOUSE_DOWN,onMouseDownFun);
stage.addEventListener(flash.events.MouseEvent.MOUSE_UP,onMouseUpFun);
}
private function onMouseDownFun(events:flash.events.MouseEvent):void {
this.graphics.moveTo(mouseX,mouseY);
stage.addEventListener(flash.events.MouseEvent.MOUSE_MOVE,onMouseMoveFun);
}
private function onMouseUpFun(events:flash.events.MouseEvent):void {
stage.removeEventListener(flash.events.MouseEvent.MOUSE_MOVE,onMouseMoveFun);
}
private function onMouseMoveFun(events:flash.events.MouseEvent):void{
this.graphics.lineTo(mouseX,mouseY);
}
}
}
这样才能正常运行,不应该啊,应该不需要把所有的events:flash.events.MouseEvent都写全啊 展开
有些类我之前测试是没有错误的,现在测试就出现了以上错误……
这两天,我删除了D盘目录里的一个有关flash的txt文件,还修复了Host,就没有别的敏感操作了
软件也完全卸载然后 重新安装了,
我彻底没辙了,求助啊~~~~~~~~
以下是原码:
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
public class DrawingApp extends Sprite {
public function DrawingApp() {
init()// constructor code
}
private function init():void {
graphics.lineStyle(1);
stage.addEventListener(MouseEvent.MOUSE_DOWN,onMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP,onMouseUp);
}
private function onMouseDown(event:MouseEvent):void {
graphics.moveTo(mouseX,mouseY);
stage.addEventListener(MouseEvent.MOUSE_MOVE,onMouseMove);
}
private function onMouseUp(event:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE,onMouseMove);
}
private function onMouseMove(event:MouseEvent):void{
graphics.lineTo(mouseX,mouseY);
}
}
}
但凡是包含MouseEvent的,都出错了,无一例外
最新尝试如下:
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
public class DrawingApp extends Sprite {
public function DrawingApp() {
init()// constructor code
}
private function init():void {
this.graphics.lineStyle(1);
stage.addEventListener(flash.events.MouseEvent.MOUSE_DOWN,onMouseDownFun);
stage.addEventListener(flash.events.MouseEvent.MOUSE_UP,onMouseUpFun);
}
private function onMouseDownFun(events:flash.events.MouseEvent):void {
this.graphics.moveTo(mouseX,mouseY);
stage.addEventListener(flash.events.MouseEvent.MOUSE_MOVE,onMouseMoveFun);
}
private function onMouseUpFun(events:flash.events.MouseEvent):void {
stage.removeEventListener(flash.events.MouseEvent.MOUSE_MOVE,onMouseMoveFun);
}
private function onMouseMoveFun(events:flash.events.MouseEvent):void{
this.graphics.lineTo(mouseX,mouseY);
}
}
}
这样才能正常运行,不应该啊,应该不需要把所有的events:flash.events.MouseEvent都写全啊 展开
3个回答
展开全部
我把你的代码复制下来,用FB运行来一下,没有错误。
要不你重新敲一遍代码吧!
以前遇到过没错误,但就是报错,我删了,重新敲了一遍,就好了。
试一试吧,不行在说
要不你重新敲一遍代码吧!
以前遇到过没错误,但就是报错,我删了,重新敲了一遍,就好了。
试一试吧,不行在说
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
public class DrawingApp extends Sprite {
public function DrawingApp() {
init()// constructor code
}
private function init():void {
this.graphics.lineStyle(1);
stage.addEventListener(MouseEvent.MOUSE_DOWN,onMouseDownFun);
stage.addEventListener(MouseEvent.MOUSE_UP,onMouseUpFun);
}
private function onMouseDownFun(event:MouseEvent):void {
this.graphics.moveTo(mouseX,mouseY);
stage.addEventListener(MouseEvent.MOUSE_MOVE,onMouseMoveFun);
}
private function onMouseUpFun(event:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE,onMouseMoveFun);
}
private function onMouseMoveFun(event:MouseEvent):void{
this.graphics.lineTo(mouseX,mouseY);
}
}
}
import flash.display.Sprite;
import flash.events.MouseEvent;
public class DrawingApp extends Sprite {
public function DrawingApp() {
init()// constructor code
}
private function init():void {
this.graphics.lineStyle(1);
stage.addEventListener(MouseEvent.MOUSE_DOWN,onMouseDownFun);
stage.addEventListener(MouseEvent.MOUSE_UP,onMouseUpFun);
}
private function onMouseDownFun(event:MouseEvent):void {
this.graphics.moveTo(mouseX,mouseY);
stage.addEventListener(MouseEvent.MOUSE_MOVE,onMouseMoveFun);
}
private function onMouseUpFun(event:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE,onMouseMoveFun);
}
private function onMouseMoveFun(event:MouseEvent):void{
this.graphics.lineTo(mouseX,mouseY);
}
}
}
更多追问追答
追问
错误依旧。。
追答
晕了, 你在CS5.5编译正常才发给你的...
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询