A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: yet another question (its a small one)

  1. #1
    Senior Member cyber reaper's Avatar
    Join Date
    Apr 2004
    Location
    israel
    Posts
    272

    yet another question (its a small one)

    i created two buttons ,one wich increase a number at the edit box
    by 1 and the other wich decreaseit by 1 (i used ++ command)
    however when i tried to make the buttons to increase/decrease by 2
    they where still increasing/decreasing by 1 and now the each one
    of them increases/decreases two different numbers (for ex:i clicked on the increase button 4 times-the number increased to 5 but then
    i clicked on the decrease button and the number returns to 1)
    (i used the command : text = ++2)

    in other words my question is how to make and increasement/decreasement by more then 1 ?
    ok....what ?

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    to increase by 2 use +=2

    for a variable named myvar you

    myvar+=2
    (decrease is -=2)

    Or if you want it to be easier to read just

    myvar=myvar+2
    (decrease is myvar=myvar-2)

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