//Defining a function to attach the symbol to the main movie clip //Flag is a boolean variable which checks if MC needs to be attached or removed function scanInput() { for(i = 1; i < 5 ;i++) { this['Hair' + i].btnIndex = i; this['Hair' + i].onRelease = function() { this['Hair'+i]._visible=false; } } } scanInput();