# AS2: counter variable - PLEASE HELP

**URL:** <https://forum.kirupa.com/t/as2-counter-variable-please-help/288938>\
**Category:** flash\
**Created:** [May 23, 2009, 1:54pm UTC](https://forum.kirupa.com/t/as2-counter-variable-please-help/288938 "2009-05-23T13:54:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adiosamigos](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@adiosamigos](https://forum.kirupa.com/u/adiosamigos)\
**Post date:** [May 23, 2009, 1:54pm UTC](https://forum.kirupa.com/t/as2-counter-variable-please-help/288938/1 "2009-05-23T13:54:23Z")

</div>

Hi

I am using the attachMovie script in as2 and I want to use a counter variable to increase the depth each time so it doesn’t replace the last one. Every tutorial i’ve seen for attachMovie mentions this but I can’t find any information on how.

Also is it possible to use a different counter variable to change to y position of the attached movieclip, so that it adds another beneath the last every time.

Thanks a lot.

Tom
