# Accessing Dynamic Variables

**URL:** <https://forum.kirupa.com/t/accessing-dynamic-variables/178962>\
**Category:** flash\
**Created:** [February 15, 2006, 6:52pm UTC](https://forum.kirupa.com/t/accessing-dynamic-variables/178962 "2006-02-15T18:52:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgarimella](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rgarimella](https://forum.kirupa.com/u/rgarimella)\
**Post date:** [February 15, 2006, 6:52pm UTC](https://forum.kirupa.com/t/accessing-dynamic-variables/178962/1 "2006-02-15T18:52:36Z")

</div>

Hi Folks,

I have the following code that populates the variable from an array

var divergent1 = resultarr[0].step\_no ; // This Gets the val “Step1”  
var divergent1 = divergent1.charAt(4); // This gets the value 1

I need to send it to a mc based on the number

_parent[bar\_A\_mc]["a_" + divergent1].gotoAndStop(2);

What is wrong with the above code

\_parent.bar\_A\_mc.a\_1.gotoAndStop(2); // This works but need dynamic

Thanks

RG
