# As blocks

**URL:** <https://forum.kirupa.com/t/as-blocks/157440>\
**Category:** Uncategorized\
**Created:** [August 2, 2005, 12:42am UTC](https://forum.kirupa.com/t/as-blocks/157440 "2005-08-02T00:42:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkostons](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@jkostons](https://forum.kirupa.com/u/jkostons)\
**Post date:** [August 2, 2005, 12:42am UTC](https://forum.kirupa.com/t/as-blocks/157440/1 "2005-08-02T00:42:53Z")

</div>

Hi!

I have a code that sets the frameposition for 2 movieclips. However if you click a button and the \_currentframe does not match those in the code the 2 mc’s totally block…

```auto

product.onRelease = function(){
	 _root.beginScherm.voorbeeld.companyMC.onEnterFrame = function(){
		   if(this._currentframe == 19){
				_root.beginScherm.voorbeeld.companyMC.gotoAndPlay(20);
	}
		   if(this._currentframe == 36){
				_root.beginScherm.voorbeeld.productMC.gotoAndPlay(2);
				_root.beginScherm.voorbeeld.companyMC.gotoAndStop(1); 
	 delete this.onEnterFrame
	}
}
}
company.onRelease = function(){
	_root.beginScherm.voorbeeld.productMC.onEnterFrame = function(){
		   if(this._currentframe == 50){
				_root.beginScherm.voorbeeld.productMC.gotoAndPlay(51);
 
				}
		   if(this._currentframe == 87){
				_root.beginScherm.voorbeeld.companyMC.gotoAndPlay(2);
				_root.beginScherm.voorbeeld.productMC.gotoAndStop(1);
	 delete this.onEnterFrame
	}
}
}

```

Is there something i can add to this code to ignore clicks on the buttons if it does not meet the demands in the code? For example by blocking all buttons if not on the frames described in the code?
