Creating a buttons Class

So here’s my AS for my buttons:[COLOR=#000080]


missionTab.onRollOver = function() {
    if (_root.currentTab == missionTab) {
        //
    } else {
        this.gotoAndPlay(2);
    }
};

missionTab.onRollOut = function() {
    if (_root.currentTab == missionTab) {
        //
    } else {
        this.gotoAndPlay(8);
    }
};

missionTab.onRelease = function() {
    if (_root.currentTab == missionTab) {
        // it wont be
    } else {
        // put the current tab back to position
        _root.currentTab.gotoAndPlay(8);
        // set the new current tab
        
        trace(_root.currentTab);
        _root.currentTab = missionTab;
        _root.xmlPage = "xml/vision/mission.xml";
        _root.mainStage.loadXML();
    }
};

[/COLOR]And, I’ve got like a million of these buttons throughout my movie… So, I figured that it would be smarter to put this into a class so that I can reuse it all I want and not have a trillion lines of code to have to sift through. They’re all going to be doing the exact same thing, other than the names and associated xml files, etc.

Can someone please break this down for me… I’ve never been comfortable with Classes, yet I see so many instances of where a Class would be useful.

Thank you.