Skip to main content
Participating Frequently
April 5, 2012
Answered

Please Help With Error 1086

  • April 5, 2012
  • 1 reply
  • 2080 views

Hello. I was writing a program. Below is the program I've written. There was an error that said

Scene 1, Layer 'Car', Frame 1, Line 7   1086: Syntax error: expecting semicolon before leftbrace.

I've put a semicolon there and I got about 37 errors about properties and such.

So can someone tell me what is wrong with this program please?

onClipEvent(load)

{

    speed =0 ;

}

onClipEvent (enterFrame) {

if (Key.isDown(Key.UP)) {

    speed +=1;

}

if (Key.isDown(Key.DOWN)) {

    speed -=1;

}

if (Math.abs(speed)>20) {

    speed *= .7;

}

if (Key.isDown(Key.LEFT)) {

    _rotation -= 15;

}

if (Key.isDown(Key.RIGHT)) {

    _rotation += 15;

}

    speed *= .98;

x = Math.sin(_rotation*(Math.PI/180))*speed;

y = Math.cos(_rotation*(Math.PI/180))*speed*-1;

if (!_root.land.hitTest(_x+x, _y+y, true)) {

    _x += x;

    _y += y;

} else {

    speed *= -.6;

}

}

This topic has been closed for replies.
Correct answer Ned Murphy

You should be posting in the AS1/AS2 forum.  This is the AS3 forum and the code you are using is AS2.  If your file happens to be an AS3 file then you need to change to using AS3 code.  If you intend to be using AS2, then you might need to change your Publish Settings for that.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
April 5, 2012

You should be posting in the AS1/AS2 forum.  This is the AS3 forum and the code you are using is AS2.  If your file happens to be an AS3 file then you need to change to using AS3 code.  If you intend to be using AS2, then you might need to change your Publish Settings for that.

Losan33Author
Participating Frequently
April 5, 2012

Sorry. I am a student and I don't know much about Flash programming. I was unaware that this wouldn't work in AS3. I tried with AS2 and it worked. Thank you very much.

Ned Murphy
Legend
April 5, 2012

You're welcome