# Using a variable to reference an object

**URL:** <https://forum.kirupa.com/t/using-a-variable-to-reference-an-object/103210>\
**Category:** Uncategorized\
**Created:** [March 3, 2004, 12:05am UTC](https://forum.kirupa.com/t/using-a-variable-to-reference-an-object/103210 "2004-03-03T00:05:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![naderslim](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@naderslim](https://forum.kirupa.com/u/naderslim)\
**Post date:** [March 3, 2004, 12:05am UTC](https://forum.kirupa.com/t/using-a-variable-to-reference-an-object/103210/1 "2004-03-03T00:05:57Z")

</div>

Hello all,

I desperately hoping someone can shed light on my problem. I am trying to reference a movieclip with a variable. I’ve done it before but in loops reading from xmlobjects but cannot get it to work in the most simplist way…??

var i = 0;  
\_root.movie\*.\_visible=0;

should be just the same as

\_root.movie0.\_visible=0;

should it not?

I have attached the .fla

thanks so much to anyone who can help me on this…its killling me…
