1119访问可能未定义的属性aa(通过static类型class引用) aa是原件ball里面的实例名,ball与ball .as链接了
package{importflash.display.MovieClip;importflash.events.*;importflash.utils.Timer;pu...
package
{
import flash.display.MovieClip;
import flash.events.*;
import flash.utils.Timer;
public class ball extends MovieClip
{
private var movelong:Number;
private var ballTimer:Timer;
static var clickcount:int=0;
public function ball(_movelong:Number)
{
movelong=_movelong;
ballTimer=new Timer(40,0);
this.addEventListener(MouseEvent.CLICK,clickBall);
ballTimer.addEventListener(TimerEvent.TIMER,moveBall);
ballTimer.start();
}
private function clickBall(e:MouseEvent)
{
parent.removeChild(this);
clickcount++;
}
private function moveBall(e:TimerEvent)
{
var r=root
if(cqrballGame.Status==1) //判断状态
{
ball.aa=visible;
ball.bb=visible;
ball.cc=true;
this.y=this.y-movelong;
}
else if(cqrballGame.Status==2)
{
ball.aa=false;
ball.cc=false;
ball.bb=true;
this.y=this.y-movelong*2;
//汽球上什速度加快
}
else
ball.cc=false;
ball.bb=false;
ball.aa=true;
{
this.y=this.y-movelong*5;}
}
}
} 展开
{
import flash.display.MovieClip;
import flash.events.*;
import flash.utils.Timer;
public class ball extends MovieClip
{
private var movelong:Number;
private var ballTimer:Timer;
static var clickcount:int=0;
public function ball(_movelong:Number)
{
movelong=_movelong;
ballTimer=new Timer(40,0);
this.addEventListener(MouseEvent.CLICK,clickBall);
ballTimer.addEventListener(TimerEvent.TIMER,moveBall);
ballTimer.start();
}
private function clickBall(e:MouseEvent)
{
parent.removeChild(this);
clickcount++;
}
private function moveBall(e:TimerEvent)
{
var r=root
if(cqrballGame.Status==1) //判断状态
{
ball.aa=visible;
ball.bb=visible;
ball.cc=true;
this.y=this.y-movelong;
}
else if(cqrballGame.Status==2)
{
ball.aa=false;
ball.cc=false;
ball.bb=true;
this.y=this.y-movelong*2;
//汽球上什速度加快
}
else
ball.cc=false;
ball.bb=false;
ball.aa=true;
{
this.y=this.y-movelong*5;}
}
}
} 展开
2个回答
展开全部
xro改好了,代码改成这样就好了,不过去掉了参数才行的:
package {
import flash.events.MouseEvent;
import flash.display.MovieClip;
public class aa extends MovieClip {
public function aa() {
stage.addEventListener(MouseEvent.MOUSE_DOWN,say);
}
public function say(event:MouseEvent) {
trace(mouseX);
}
}
}
执行代码:
var asa:aa=new aa();
也可以不执行jvz
package {
import flash.events.MouseEvent;
import flash.display.MovieClip;
public class aa extends MovieClip {
public function aa() {
stage.addEventListener(MouseEvent.MOUSE_DOWN,say);
}
public function say(event:MouseEvent) {
trace(mouseX);
}
}
}
执行代码:
var asa:aa=new aa();
也可以不执行jvz
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询