16
Aug

Did you know about AS3 “down to” operator?

I am talking about –> operator. Did you know about it? It’s called “down to” operator. Here’s an example.

var a:uint = 20;
while ( a --> 0 ) trace(a);

Isn’t it cool?!

Tags: , ,

  • http://va.lent.in Valentin

    Got ya!? Actually it’s while (a– > 0) trace(a);
    But so many people believe this. Got this one from here. Great read till like page 7.

    • http://www.daylyn.net daylyn

      i never notice that~haha~

  • Brendan

    for(var i = 0, j = 0; i < 10, j < 20; i++, j++){
    trace(i,j)
    }

    didn't know you could do this, :)

  • http://www.regul-flash.com Regul

    Hi! I do not understand where does “down to” operator (–>)???
    I you example you use “–” decrement operator and comparison with “>0″. This example should look like:

    var a:uint = 20;
    while ( a — ) trace(a); // or “while ( a– > 0 ) trace(a);

  • http://www.regul-flash.com Regul

    My previous comment was spoiled! It is probably some auto correction.

    • http://va.lent.in Valentin

      read the first comment lol