Button on/off problem

I have a MC that is duplicated 15 times on my stage. Each one has it’s own instance name. This MC has two frames inside, one labeled "on’ and one labeled “off”. These frames contain a button in them. a* is the instance name of the MC and “bb” is the instance name of the button inside the MC.

Then on my main timeline I have the following script


a1.bb.onRelease = function() {
        loadMovie("flash/real_estate/1HG_engad.jpg", _root.container);
		_root.cap.gotoAndStop("at1");
		a1.gotoAndStop("on");
		a2.gotoAndStop("off");
		a3.gotoAndStop("off");
		a4.gotoAndStop("off");
		a5.gotoAndStop("off");
		a6.gotoAndStop("off");
		a7.gotoAndStop("off");
}

a2.bb.onRelease = function() {
        loadMovie("flash/real_estate/1HG_chiad.jpg", _root.container);
		_root.cap.gotoAndStop("at2");
		a2.gotoAndStop("on");
		a1.gotoAndStop("off");
		a3.gotoAndStop("off");
		a4.gotoAndStop("off");
		a5.gotoAndStop("off");
		a6.gotoAndStop("off");
		a7.gotoAndStop("off");
}

When I click on the button a1 and then click else where like a2 or a3, etc it works. The buttons turn on and off just fine. Although when I come back to a1 nothing happens (none of the script above on a1 is being read if I click on other buttons and then click back)

Anyone know what’s going on here?

Sandman9