# Clip names and array push

**URL:** https://forum.kirupa.com/t/clip-names-and-array-push/328361
**Category:** Uncategorized
**Created:** [May 10, 2012, 5:07pm UTC](https://forum.kirupa.com/t/clip-names-and-array-push/328361 "2012-05-10T17:07:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![paulscanlon\_99](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@paulscanlon\_99](https://forum.kirupa.com/u/paulscanlon_99)
#### Post date: [May 10, 2012, 5:07pm UTC](https://forum.kirupa.com/t/clip-names-and-array-push/328361/1 "2012-05-10T17:07:43Z")

</div>

hi all hoping someone can help me out, i’m adding a number of library movie clips to my stage using an external as file.  
The names of the library clips are stored in an array like so:

public var spriteArray:Array = new Array("\_one","\_in","\_seven")

for (var i:Number = 0; i\<spriteArray.length; i++) {  
mcName = spriteArray\*;  
mcClass = getDefinitionByName(mcName) as Class;  
mcInst = new mcClass() as MovieClip;

```
mcInst.name = spriteArray*
namesArray.push(mcInst)
    addChild(mcInst);
			
mcInst.scaleX = clipScale;
}

```

}

this is all cool and i can modify the scaleX from inside the for loop but i will be needing another function that loops over all the clips on the stage and applies an alpha fade for example.

how can i access the clips? where have they actually been added, this doesn’t throw any errors but doesn’t seem to do anything

public function anotherFunction():void {  
for (var i:Number = 0; i\<spriteArray.length; i++) {  
namesArray\*.alpha = 0;  
}  
}

i was hoping that using mcInst.name = spriteArray\* / namesArray.push(mcInst) would work. Do i need to push the names in as a type, movieClip or something so i can later reference them from other functions? obviously missing something critical here ay!

any help would be appreciated.
