A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Please help! 1086 syntax error (New)

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    2

    Please help! 1086 syntax error (New)

    Hi, I am trying to follow the "move sprites with keyboards" tutorial. the code I was given is:

    onClipEvent(enterFrame) {
    if(Key.isDown(Key.UP)) this._y-=3
    if(Key.isDown(Key.DOWN)) this._y+=3
    if(Key.isDown(Key.LEFT)) this._x-=3
    if(Key.isDown(Key.RIGHT)) this._x+=3 }

    when i put this in i get:
    Scen 1, layer 'red car', Frame1, Line 1 1086: Syntax error: expecting semicolon before rightparen.

    If i try doing this I get a whole bunch of new errors. If anybody could help I would greatly appreciate it. I am usin Flash CS5 if that changes anything.

  2. #2
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    try this:

    onClipEvent(enterFrame) {
    if(Key.isDown(Key.UP)){ this._y-=3;}
    if(Key.isDown(Key.DOWN)){ this._y+=3;}
    if(Key.isDown(Key.LEFT)){ this._x-=3;}
    if(Key.isDown(Key.RIGHT)){ this._x+=3;}
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center