Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Dec 2005
    Location
    North Da' Kota'
    Posts
    269

    What is a syntax error?

    I get "syntax errors" a lot, and I want to know what they are. Here is the code and the error message. What is wrong? and what is a syntax error?

    stop();
    function initGame() {
    attachMovie("man", "man", 999999);
    man._x = 275;
    man._y = 350;
    }
    funtion moveMan() {
    if (man._currentFrame>4) {
    dx = 0;
    } else if (Key.isDown(Key.RIGHT)) {
    dx = dgspeed;
    man.gotoAndStop("right");
    } else if (Key.isDown(Key.LEFT)) {
    dx = -dgspeed;
    man.gotoAndStop("left");
    } else {
    dx = 0;
    man.gotoAndStop("normal")
    }
    rect._x += dx;
    if (man._x<45) {
    man._x = 45;
    }
    if (man._x<650) {
    man._x = 650;
    }
    if (bgspeed<5) {
    bgspeed += .05;
    }
    }


    and the error:

    **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
    funtion moveMan() {

    Total ActionScript Errors: 1 Reported Errors: 1

  2. #2
    Veteran Enthusiast


    Join Date
    Sep 2005
    Location
    Dorset, England
    Posts
    6,792
    i don't know but sometimes there is either a . or something inbetween the moveMan. I don't know, if i knew i'd help you for sure. Also maybe if you told us what this is for


    ...........[img]http://**********.com/img/1215620802.jpg[/img]
    LAZYTOWN FOR THE WIN!
    Quote Originally Posted by silverlucario
    Um... Can you please stop calling Kankuro a clown? It's hurting my feelings

  3. #3
    Fanatic Enthusiast Toastmaster's Avatar


    Join Date
    Mar 2005
    Location
    Texas
    Posts
    4,999

    Re: What is a syntax error?

    Quote Originally Posted by Capamerica
    :
    **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
    funtion moveMan() {

    Total ActionScript Errors: 1 Reported Errors: 1
    It means that 'function moveMan () {' is worded wrong and flash doesn't understand it.

    Make sure you don't need to change that line somehow, even capitalization matters in actionscript, so double check that line and make sure you didn't do somthing wrong ^_^

  4. #4
    Senior Member
    Join Date
    Dec 2005
    Location
    North Da' Kota'
    Posts
    269
    Okay, thanks, I think I got it. The M in Man wasn't supposed to be capitalized.

  5. #5
    Senior Member
    Join Date
    Dec 2005
    Location
    North Da' Kota'
    Posts
    269
    Nevermind, that isn't it. Hmm, here is the tutorial I am trying to do, that has the code with the error.

    http://www.tutorialized.com/tutorial...him-shoot/4999


 

Posting Permissions

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