# If statement for rollovers

**URL:** https://forum.kirupa.com/t/if-statement-for-rollovers/275064
**Category:** Uncategorized
**Created:** [November 8, 2008, 4:42pm UTC](https://forum.kirupa.com/t/if-statement-for-rollovers/275064 "2008-11-08T16:42:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jhdc](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jhdc](https://forum.kirupa.com/u/jhdc)
#### Post date: [November 8, 2008, 4:42pm UTC](https://forum.kirupa.com/t/if-statement-for-rollovers/275064/1 "2008-11-08T16:42:13Z")

</div>

```auto
targetBtn.onRollOver = function()
	{
		if (lastBtn == _level0.btn1)
		{
			TweenLite.to(this.txt,.4,{_alpha:0, _xscale:50, _yscale:50});
			;
			TweenGroup.allTo(photoArray_show,.4,{_alpha:100});
	

			switch (targetBtn)
			{
				case _level0.btn2 :
					TweenLite.to(titleTxt2,.4,{_alpha:100});
					break;

```

I am using this code for my menu button rollovers.  
It’s working, but I don’t want the rollovers to be active until this function is complete:

```auto
function show()
{
	TweenGroup.allTo([box_mc, txtArray],.4,{_alpha:100});
	var i:Number = 0;
	incrementText = setInterval(changeText, 166);

	function changeText()
	{
		if (i <= 47)
		{
			box_mc.sadieTxt.text = txtArray*;
			i++;
		} else
		{
			clearInterval(incrementText);
		}
	}
}

```

Any ideas of how I can do this?  
Thanks!
