Hi All,
i have incuded an AS file in my fla. But is gives an error
[COLOR=Red]ball.as: Line 73: ActionScript 2.0 class scripts may only define class or interface constructs.
}[/COLOR]
What should i do to remove this error
Here is the code of **ball.as
**[COLOR=Blue]//Ball class
function move()
{
if (Math.abs(_stepx) < 0.1)
{
_stepx = 0;
}
_stepy += _root.YGRAVITY;
_y += _stepy;
if (_stepx != 0)
{
_x += _stepx;
if (_stepx > 0)
{
_stepx -= _root.XGRAVITY;
}
else
{
_stepx += _root.XGRAVITY;
}
if (_x < _root.LEFTBORDER + _root.BALLW2)
{
_x = _root.LEFTBORDER + _root.BALLW2;
_stepx = -_stepx * _root.WALLREFLECTION;
if (Math.abs(_stepx) > _root.MINHITSPEED)
{
_root.playSound(“snd_refl”);
}
}
if (_x > _root.RIGHTBORDER - _root.BALLW2)
{
_x = _root.RIGHTBORDER - _root.BALLW2;
_stepx = -_stepx * _root.WALLREFLECTION;
if (Math.abs(_stepx) > _root.MINHITSPEED)
{
_root.playSound(“snd_refl”);
}
}
}
if (_y < _root.UPBORDER + _root.BALLW2)
{
_y = _root.UPBORDER + _root.BALLW2;
_stepy = -_stepy;
if (Math.abs(_stepy) > _root.MINHITSPEED)
{
_root.playSound(“snd_refl”);
}
}
if (_y > _root.DOWNBORDER - _root.BALLW2)
{
_y = _root.DOWNBORDER - _root.BALLW2;
_stepy = -_stepy * _root.WALLREFLECTION;
if (_root.hiscores < _root.hits)
{
_root.hiscores = _root._hits;
_root._hiscores = _root.hiscores;
_root.sp1 = ‘Spoints: ’ + _root.hits / 3;
_root.submitScores();
}
else if (_root.hits >= 1)
{
// getURL(‘javascript:alert(’ + _root.hits +’);’);
// getURL(‘javascript:alert("’ + _root.sp1 +’");’);
_root.sp1 = 'Spoints: ’ + _root.hits / 3;
_root.submitScores();
}
else
{
_root.history.unshift(_root.hits);
_root.history.sort(_root.compareFunction);
_root.history.length = 5;
_root.hits = 0;
_root._hits = _root.hits;
}
if (Math.abs(_stepy) > _root.MINHITSPEED)
{
_root.playSound(“snd_refl”);
}
}
_cspeed = _stepx * _root.RK;
if (_cspeed != 0)
{
_rotation += _cspeed;
}
_root.shadow._x = _x;
_root.shadow._xscale = 100 - ((450 - _y) / 4.5);
_root.shadow._yscale = 100 - ((450 - _y) / 4.5);
}
function press()
{
_delx = (_x - _root._xmouse) / _root.XK;
_dely = (_root._ymouse - _y) / _root.YK;
if ((_stepy > 0 && delx < 0) || (_stepy < 0 && delx > 0))
{
_stepx = -_stepx * _root.FOOTREFLECTION;
}
_stepx += _delx;
if (_stepy > 0)
{
_stepy = -_stepy * _root.FOOTREFLECTION;
}
if (_dely > 0 && _dely > _root.YMINDEL)
{
_stepy -= _dely;
}
else
{
_stepy -= _root.YMINDEL;
}
_root.hits++;
_root._hits = _root.hits;
this.gotoAndPlay(2);
_root.playSound(“snd_hit”);
_root.startDeformation();
}
[/COLOR]**
PLZ help
Thanks
**