flash8提示:**错误** 场景=场景 1, 图层=AS, 帧=1 20
//declareandsetinitialvariablesandpropertiesdragging=false;angle=0;xSpeed=0;initx=joy...
//declare and set initial variables and properties
dragging=false;
angle=0;
xSpeed=0;
initx=joystick._x;
inity=joystick._y;
tension=.5;
decay=.5
//determine whether dragging or not
joystick.onPress=function(){
dragging=true;
};
joystick.onRelease=function(){
dragging=false;
};
joystick.onReleaseOutside=function(){
dragging=false;
_root.onEnterFrame=function(){
with(joystick){
if(dragging){
//calculate the angle of the joystick
angle=Math.atan2(_root._ymouse-inity,_root._xmouse-initx)/(Math.PI/180);
_rotation=angle;
with(knob){
//rotate the knob inversely to the rotation of the whole joystick
_rotation=-angle;
//drag the joystick but constrain it to a circle with a radius of 75
_x=_parent._xmouse;
if(_x>75){
_x=75;
}
}
with(beetle){
//set rotation of beetle equal to the rotation of the joystick
_rotation=angle;
//loop to opposite side of the masked area when the beetle travels off-screen
if(_y<0){
_y=231;
}
if(y>231){
_y=0;
}
if(_x<231){
_x=465;
}
if(_x>465){
_x=231;
}
//move the beetle in proportion to how far the joystick is dragged from its center
_y+=Math.sin(angle*(PI180))*(knob._x/8);
_x+=Math.cos(angle*(PI180))*(knob._x/8);
}
}else{
//snap back to center when the joystick is released
xSpeed=-knob._x*tension+(xSpeed*decay);
knob._x+=xSpeed;
}
//maintain position and rotation of beetle shadow
with(shadow){
_x=beetle._x+3;
_rotation=beetle._rotation;
}
};
出现下面问题:
**错误** 场景=场景 1, 图层=AS, 帧=1:第 18 行: 语句块必须以 '}' 结束
_root.onEnterFrame=function(){
**错误** 场景=场景 1, 图层=AS, 帧=1:第 63 行: 语法错误。
};
**错误** 场景=场景 1, 图层=AS, 帧=1:第 16 行: 语句块必须以 '}' 结束
joystick.onReleaseOutside=function(){
**错误** 场景=场景 1, 图层=AS, 帧=1:第 63 行: 语法错误。
};
ActionScript 错误总数:4 报错:4 展开
dragging=false;
angle=0;
xSpeed=0;
initx=joystick._x;
inity=joystick._y;
tension=.5;
decay=.5
//determine whether dragging or not
joystick.onPress=function(){
dragging=true;
};
joystick.onRelease=function(){
dragging=false;
};
joystick.onReleaseOutside=function(){
dragging=false;
_root.onEnterFrame=function(){
with(joystick){
if(dragging){
//calculate the angle of the joystick
angle=Math.atan2(_root._ymouse-inity,_root._xmouse-initx)/(Math.PI/180);
_rotation=angle;
with(knob){
//rotate the knob inversely to the rotation of the whole joystick
_rotation=-angle;
//drag the joystick but constrain it to a circle with a radius of 75
_x=_parent._xmouse;
if(_x>75){
_x=75;
}
}
with(beetle){
//set rotation of beetle equal to the rotation of the joystick
_rotation=angle;
//loop to opposite side of the masked area when the beetle travels off-screen
if(_y<0){
_y=231;
}
if(y>231){
_y=0;
}
if(_x<231){
_x=465;
}
if(_x>465){
_x=231;
}
//move the beetle in proportion to how far the joystick is dragged from its center
_y+=Math.sin(angle*(PI180))*(knob._x/8);
_x+=Math.cos(angle*(PI180))*(knob._x/8);
}
}else{
//snap back to center when the joystick is released
xSpeed=-knob._x*tension+(xSpeed*decay);
knob._x+=xSpeed;
}
//maintain position and rotation of beetle shadow
with(shadow){
_x=beetle._x+3;
_rotation=beetle._rotation;
}
};
出现下面问题:
**错误** 场景=场景 1, 图层=AS, 帧=1:第 18 行: 语句块必须以 '}' 结束
_root.onEnterFrame=function(){
**错误** 场景=场景 1, 图层=AS, 帧=1:第 63 行: 语法错误。
};
**错误** 场景=场景 1, 图层=AS, 帧=1:第 16 行: 语句块必须以 '}' 结束
joystick.onReleaseOutside=function(){
**错误** 场景=场景 1, 图层=AS, 帧=1:第 63 行: 语法错误。
};
ActionScript 错误总数:4 报错:4 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询