# Assign var value to mc both taken from array

**URL:** <https://forum.kirupa.com/t/assign-var-value-to-mc-both-taken-from-array/181383>\
**Category:** Uncategorized\
**Created:** [March 8, 2006, 8:17pm UTC](https://forum.kirupa.com/t/assign-var-value-to-mc-both-taken-from-array/181383 "2006-03-08T20:17:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onsitus](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/onsitus/32/971_2.png) [@onsitus](https://forum.kirupa.com/u/onsitus)\
**Post date:** [March 8, 2006, 8:17pm UTC](https://forum.kirupa.com/t/assign-var-value-to-mc-both-taken-from-array/181383/1 "2006-03-08T20:17:41Z")

</div>

Hello,

I can’t seem to find a way around this one.

2 arrays:

//array containing mc instance name placed on stage  
var mc\_array = new Array(mc1, mc2, mc3, mc4, mc5, mc6, mc7, mc8, mc9, mc10, mc11);  
//array of values for var selMc, to be assigned to mcs  
var selMc\_array = new Array(“mc1”, “mc2”, “mc3”, “mc4”, “mc5”, “mc6”, “mc7”, “mc8”, “mc9”, “mc10”, “mc11”);

Basically I’m trying to do that when mc\_array[0] is pressed it traces the value of selMc\_array[0], for mc\_array[1]/selMc\_array[1]…blabla for the eleventh of them.

I tried with for(g in mc\_array), trace mc1 ; for(i=0,i\<mc\_array,i++) and while which trace mc11 whichever mc you press, plus any type of combination of if/else/onEnterFrame.:cantlook: Anyway I run out of idea and I’ve been searching all afternoon for a solution.

Any kind soul who could put me in the right direction, please.

🍺
