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