AS3.0 TypeError: Error #1009: 无法访问空对象引用的属性或方法 5
stop();pointTx.text=pointadd1p2.addEventListener(MouseEvent.CLICK,adding1p2);add1p2O....
stop();
pointTx.text=point
add1p2.addEventListener(MouseEvent.CLICK,adding1p2);
add1p2O.addEventListener(MouseEvent.CLICK,adding1p2);
add2p2.addEventListener(MouseEvent.CLICK,adding2p2);
backBt.addEventListener(MouseEvent.CLICK,back);
function adding1p2(event:MouseEvent):void{
point+=1;
pointTx.text=point;
trace(point+"/"+points+"-"+player)
if(point==points-1){
add1p1O.x=250
add1p1O.y=350
}
if(point>=points){
gotoAndPlay(6);
}else{
player=2;
gotoAndPlay(3);
}
}
function adding2p2(event:MouseEvent):void{
point+=2
pointTx.text=point
trace(point+"/"+points+"-"+player)
if(point==points-1){
add1p1O.x=250
add1p1O.y=350
}
if(point>=points){
gotoAndPlay(6);
}else{
player=2;
gotoAndPlay(3);
}
}
测试时出现以下问题:
TypeError: Error #1009: 无法访问空对象引用的属性或方法。
at _fla::MainTimeline/frame4()
at flash.display::MovieClip/gotoAndPlay()
at _fla::MainTimeline/adding1p1()
请问如何修改 展开
pointTx.text=point
add1p2.addEventListener(MouseEvent.CLICK,adding1p2);
add1p2O.addEventListener(MouseEvent.CLICK,adding1p2);
add2p2.addEventListener(MouseEvent.CLICK,adding2p2);
backBt.addEventListener(MouseEvent.CLICK,back);
function adding1p2(event:MouseEvent):void{
point+=1;
pointTx.text=point;
trace(point+"/"+points+"-"+player)
if(point==points-1){
add1p1O.x=250
add1p1O.y=350
}
if(point>=points){
gotoAndPlay(6);
}else{
player=2;
gotoAndPlay(3);
}
}
function adding2p2(event:MouseEvent):void{
point+=2
pointTx.text=point
trace(point+"/"+points+"-"+player)
if(point==points-1){
add1p1O.x=250
add1p1O.y=350
}
if(point>=points){
gotoAndPlay(6);
}else{
player=2;
gotoAndPlay(3);
}
}
测试时出现以下问题:
TypeError: Error #1009: 无法访问空对象引用的属性或方法。
at _fla::MainTimeline/frame4()
at flash.display::MovieClip/gotoAndPlay()
at _fla::MainTimeline/adding1p1()
请问如何修改 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询