Flash Components      Flash Menu      Flash Gallery      Flash Slideshow      FLV Player      Flash Form      MP3 Player      PhotoFlow      Flash CMS      3D Wall      Flash Scroller

Flash / AS



ASP.net / PHP






  Design & Effects
  Audio & Video
  User Interface





Incrementation or Decrementation
         by ilyas usal

  1. increment by 1
    First: what does increment mean? When I say that I increment a value by 1, it only means that I add 1 to this value. There are several ways I can do that, the obvious one being:

    myValue = myValue + 1;

    But there is a faster way: with the ++ operator. It will go like this:


    It has the exact same effect, but it's faster and cleaner. You can do the exact same with -, which is called decrementation:

    // equivalent to myValue = myValue - 1;

  2. Increment by another value
    This time, I want to add a number to a value. The usual way would be:

    myValue = myValue + 3;

    Well, there's a much shorter way to do that:

    myValue += 3;

    It also works with the other operators:

    myValue -= 3;
    myValue *= 3;
    myValue /= 3;

Hope this tutorial helped. If you have any questions, please post them on the forums at //www.kirupa.com/forum/


kirupa.com's fast and reliable hosting provided by Media Temple. flash components
The Text Animation Component for Flash CS3
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.
Check out our high quality vector-based design packs! Flash Effect Components
flash menus, buttons and components Digicrafts Components
The best flash components ever! Entheos Flash Website Templates
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Purchase & Download Flash Components
flash components Free Website | Make a Website
Streamsolutions Content Delivery Networks Learn how to advertise on kirupa.com