# AS3.0 -\> Updating variables

**URL:** https://forum.kirupa.com/t/as3-0-updating-variables/272869
**Category:** flash
**Created:** [October 8, 2008, 11:45pm UTC](https://forum.kirupa.com/t/as3-0-updating-variables/272869 "2008-10-08T23:45:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kpxnamja](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kpxnamja](https://forum.kirupa.com/u/kpxnamja)
#### Post date: [October 8, 2008, 11:45pm UTC](https://forum.kirupa.com/t/as3-0-updating-variables/272869/1 "2008-10-08T23:45:45Z")

</div>

Hello, I have reached an AS2.0 to AS3.0 migration problem.

My problem is finding out a way to allow multiple variables to be updated under a for loop with a variable number “i”.  
In the past, I was able to get by using this code:

```auto

for (i=0;i<totalText;i++){
    ["text"+i] = arrayB*;
}

```

On the stage were dynamic textfields with variables text0 to text’totalText’  
After the loop, everything in arrayB was allocated to the correct text variable on the stage.

However, I have had no luck in AS3.0  
The close I have gotten was updating the right side.  
The code I have at the moment is the following:

```auto

// Stage has **totalText** amount of dynamic texts that goes by the instance names: text0, text1...etc.

var holder:TextField();

for (var i:Number =0;i<totalText;i++){
    holder = ["text"+i]
    holder.text = arrayB*;
}

```

The left always gives me an error.  
Is there any work around this? Or is there a better way of achieving this task?
