A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] How do I change this code from AS2 to AS3?

Threaded View

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    24

    resolved [RESOLVED] How do I change this code from AS2 to AS3?

    Hi there, I'm using a tutorial to create a game, however it uses AS2 and I am using AS3. As a result the coding below brings up errors 1086 and 1084 (Syntax error: expecting semicolon before leftbrace and Syntax error: expecting rightbrace before leftbrace respectively) in Line 4. Can anyone help me convert this code to AS3 please?
    Here's the code:
    Actionscript Code:
    var walkSpeed:Number = 16;
    mcMain.addEventListener
    {
        onClipEvent(load){
            walkSpeed = 16;
        }
        onClipEvent(enterFrame){
            if(Key.isDown(Key.UP)){
                _y-= walkSpeed
            }
        }
    }
    Last edited by JimbobD; 02-17-2012 at 04:48 PM. Reason: Just changed title of post to match new request.

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