# Assingning Properties To Dynamically Created Movie Clips

**URL:** <https://forum.kirupa.com/t/assingning-properties-to-dynamically-created-movie-clips/205374>\
**Category:** flash\
**Created:** [October 28, 2006, 9:07pm UTC](https://forum.kirupa.com/t/assingning-properties-to-dynamically-created-movie-clips/205374 "2006-10-28T21:07:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gotsong](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gotsong/32/1936_2.png) [@gotsong](https://forum.kirupa.com/u/gotsong)\
**Post date:** [October 28, 2006, 9:07pm UTC](https://forum.kirupa.com/t/assingning-properties-to-dynamically-created-movie-clips/205374/1 "2006-10-28T21:07:50Z")

</div>

Hello, I am trying to use the duplicateMovieClip event to create a row of custom movie clips dynamically and I would like to be able to set the \_alpha properties on each object depending on an event i am firing in a different movie.

# Here is my code that actually creates the controls and locates them on the screen.

for(var i = 1;i \< argCount;i++){

```
 duplicateMovieClip(CounterBackMain_mc0,"CounterBackMain_mc"+argCount-i,argCount-i);
 this["CounterBackMain_mc"+argCount-i].textNumber_mc.textNumber.text = argCount - i;
 this["CounterBackMain_mc"+argCount-i]._x = iLocation - CounterBackMain_mc0._width + 4;
 this["CounterBackMain_mc"+argCount-i]._y = CounterBackMain_mc0._y;
 iLocation = eval("CounterBackMain_mc"+argCount-i)._x;
 
 //set("Counter"+(argCount-i),"CounterBackMain_mc"+(argCount-i));
 
 eval("CounterBackMain_mc"+argCount-i).onRollOver = function(){
         setAlpha(this.CounterBack_mc,true);
         } 
 eval("CounterBackMain_mc"+argCount-i).onRollOut = function(){
         setAlpha(this.CounterBack_mc,false);
        }
 eval("CounterBackMain_mc"+argCount-i).onPress = function(){
         //_level0.loadImages(imageArray,argCount-i)
         _level3.MainImage_mc._alpha = 100;
         _level3.setImage(Number(this.textNumber_mc.textNumber.text)-1);
         //trace(Number(this.textNumber_mc.textNumber.text));
        }
 setAlpha(eval("CounterBackMain_mc"+argCount-i).CounterBack_mc,false); 

```

}

================================================================  
Here are the functions called from the event to set the property:  
function setPictureNum(argCounter){  
//Set alpha to 0 on previous control  
setAlpha(eval(“CounterBackMain\_mc”+current\_pos).CounterBack\_mc),false);  
setAlpha(eval(“CounterBackMain\_mc”+argCounter).CounterBack\_mc"),true);  
current\_pos = argCounter;  
}

# function setAlpha(argMC,argVisible){ switch(argVisible){ case true: argMC.\_alpha = 100; break; case false: argMC.\_alpha = 0; break; } }

It does not seem to recognize the dynamic clip I am sending to the setAlpha function. Any of the initial events I set in the loop work fine. I just cannot access the properties once the loop is completed. Any suggestions would be very appreciated!!

All the Best!  
Jim Davis
