Attach a variable to a movieclip


i want to duplicate an MC and to each duplicated MC, attach a variable “counter” which will increment as movie runs.

problem is i’m confused on how to do it. I thought this would work , but apparently it does not :

var newClip:MovieClip = _level0.animation.myPen.duplicateMovieClip(penMC, _root.mainCounter);
newClip._alpha = 50;
newClip.counter = 0;
for (i=0; i<_root.mainCounter; i++) {
penMC2 = "myPen"+i;
if (_level0.animation[penMC2].counter>_root.alphaCounterEndValue) {
			var my_color:Color = new Color(_level0.animation[penMC2]);
			_level0.animation[penMC2]._alpha = 100;
		if (_root.alphaCounterStartValue<=_level0.animation[penMC2].counter<=_root.alphaCounterEndValue) {

this code is probably messy, i’m from Flash5 and flash MX coding is really confusing to me :frowning: