# What is i?

**URL:** <https://forum.kirupa.com/t/what-is-i/1130>\
**Category:** flash\
**Created:** [August 9, 2002, 3:49am UTC](https://forum.kirupa.com/t/what-is-i/1130 "2002-08-09T03:49:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lostinbeta](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@lostinbeta](https://forum.kirupa.com/u/lostinbeta)\
**Post date:** [August 9, 2002, 3:49am UTC](https://forum.kirupa.com/t/what-is-i/1130/1 "2002-08-09T03:49:40Z")

</div>

Hey anyone,

Still learning AS, but one thing I still don’t understand is how that “i” thing works.

i always see i=0 and i++ and i\<24, etc

what is it, how does it work, why the letter “i”?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2002, 3:54am UTC](https://forum.kirupa.com/t/what-is-i/1130/2 "2002-08-09T03:54:59Z")

</div>

You saw that from my ‘for loop’ on my sound object mini tutorial and I and a lot of people use ‘i’ for a default variable when counting in a loop…you can use anything, a letter, word, numder and so on, see:

```auto
for(i=1; i<24; i++) {
    //If i is less than 24 then execute this code
    //and add 1 to i every time the loop is executed
    //until i is 24 or larger
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2002, 4:01am UTC](https://forum.kirupa.com/t/what-is-i/1130/3 "2002-08-09T04:01:05Z")

</div>

ok so i++ is like saying i+1?

if so, then I think I understand everything.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2002, 4:03am UTC](https://forum.kirupa.com/t/what-is-i/1130/4 "2002-08-09T04:03:36Z")

</div>

You hit the nail on the head, ummm…or something like that.

Glad to help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2002, 4:05am UTC](https://forum.kirupa.com/t/what-is-i/1130/5 "2002-08-09T04:05:05Z")

</div>

I is used as a counter in conjunction with loop statements. It can be used in endless amounts of ways as Iylamasse has demonstrated in many of his posts. It can be used to create very intricate code structures or it can be used for simpler things as well. A very good example which I have taken from the Actionscript:The Definitive Guide(Colin Moock, great book get it if you don’t have it already). This code is used to create a certain number of duplicated instances.

onClipEvent (enterFrame) {  
for (i=1; i\<=25; i++) {  
duplicateMovieClip(first, “second” + i, i);  
\_root.first.\_y = random(300) + 1;  
\_root.first.\_x = random(300) + 1;  
}  
}

Hope this helps

Kyle  
🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2002, 4:09am UTC](https://forum.kirupa.com/t/what-is-i/1130/6 "2002-08-09T04:09:02Z")

</div>

All of that definitely helped, Thanks everyone=) 🙂 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2002, 6:20am UTC](https://forum.kirupa.com/t/what-is-i/1130/7 "2002-08-09T06:20:19Z")

</div>

I believe the reason programers have traditionaly used “i” is that it is not near either end of the chain of american letters. x y and z are all used to discribe locations in space… same thing with a b and c. Letters like m and r are used to represent various physics constants. So I think i is just a convienient letter that wasn’t being used for much of anything else. 🙂 Course I’m just guessing.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 9, 2002, 3:45pm UTC](https://forum.kirupa.com/t/what-is-i/1130/8 "2002-08-09T15:45:39Z")

</div>

Maybe it stands for International Variable…lol.
