i always being 2 doesn't make much sense (in the trace anyway).

var i:Number = 2 ;

btn.addEventListener(MouseEvent.CLICK, f1);

function f1(e:MouseEvent):void {
   if (i < 10) {
      trace("i = " + i);
      i = i+2;
   }
}


Paul

----- Original Message ----- From: "Bassam M" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, July 13, 2008 11:56 AM
Subject: [Flashcoders] loop or if


Hi guys
I have this simple question
I have this script

btn.addEventListener(MouseEvent.CLICK, f1);
function f1(e:MouseEvent):void {
var i:Number = 2 ;
if (i < 10) {
 i = i++;
 trace("i = " + i);
}
}
I want to multiple i when I click on btn I m getting i =  2 always i don't
understand I need to change fon first click 2 then second 4 and so until 10

thank u
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to