A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: ONE EASY WITH SYNTAX ;;;;;;

  1. #1
    Big Boi
    Join Date
    Jul 2001
    Location
    Rijeka, Croatia
    Posts
    612
    speed = 1;

    if (Key.isDown(Key.BACKSPACE ) and Number(t-ot)<300) {
    speed++}

    the question is....when I make some variables and want to assign some values when do I write them with the ; in the end end when i sholudn't??

    if i was gona write ......{speed++; ot=5; and maybe some other variables}

    did i put it ok or not correct me please and explain how it goes

  2. #2
    Senior Member
    Join Date
    May 2001
    Location
    Sweden
    Posts
    197
    Well if you want to put them all on a single line that's almost right. the speed++ does not require a ; after it.

    if (Key.isDown(Key.BACKSPACE ) and Number(t-ot)<300)
    {speed++ ot=5; othervar=1;}

    You'll find it's easier to read if you put the statements below eachoter though (recommended).

    if(Key.isDown(Key.BACKSPACE ) and Number(t-ot)<300){
    speed++
    ot=5;
    othervar=1;
    }

    The if statement is not finished untill the last } is set so you do not have to worry about putting the } directly below the if() or anything like that.

    Hope that helps!

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