# Loops/Var Question

**URL:** https://forum.kirupa.com/t/loops-var-question/278952
**Category:** flash
**Created:** [January 7, 2009, 11:34pm UTC](https://forum.kirupa.com/t/loops-var-question/278952 "2009-01-07T23:34:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![junta](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@junta](https://forum.kirupa.com/u/junta)
#### Post date: [January 7, 2009, 11:34pm UTC](https://forum.kirupa.com/t/loops-var-question/278952/1 "2009-01-07T23:34:10Z")

</div>

I have a loop that I want the user to be able to rollover 19 different pictures and a caption tweens into place for each pic. I assume my code below isn’t working because the var is trying to work for “Pic” and “Cap”, is that a correct assumption?

thanks, steve.

```auto
var boxMax:Number = 55;

for( var i:Number = 0; i < 19; i++ )

_root.Target["Pic" + i].onRollOver = function(){
TweenLite.to(_root.Target["Cap" + i], .5, { _y: boxMax });
}

```
