K... But I have button1, button2, button3, button4 and button5. If I click one of them it should take the number and use it for the instance names of other movieclips.
Can't I make a function that makes that thing for all of the buttons?
How you told me I should write that action for all of the buttons...
It would be:
button1.onRelease = function():Void {
var n:String = this._name.substring(6);
this._parent["txt_"+n].gotoAndPlay("txt_init");
this._parent["disp_"+n].gotoAndStop("disp_init");
};
button2.onRelease = function():Void {
var n:String = this._name.substring(6);
this._parent["txt_"+n].gotoAndPlay("txt_init");
this._parent["disp_"+n].gotoAndStop("disp_init");
};
button3.onRelease = function():Void {
var n:String = this._name.substring(6);
this._parent["txt_"+n].gotoAndPlay("txt_init");
this._parent["disp_"+n].gotoAndStop("disp_init");
};