# rollOver class problem

**URL:** https://forum.kirupa.com/t/rollover-class-problem/288942
**Category:** flash
**Created:** [May 23, 2009, 5:09pm UTC](https://forum.kirupa.com/t/rollover-class-problem/288942 "2009-05-23T17:09:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![icekomo](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@icekomo](https://forum.kirupa.com/u/icekomo)
#### Post date: [May 23, 2009, 5:09pm UTC](https://forum.kirupa.com/t/rollover-class-problem/288942/1 "2009-05-23T17:09:06Z")

</div>

Hello,  
I am trying to set up a .as package to handle all my rollover functions for my \_mc’s that are acting as buttons in my fla file.  
Here is the code I have .

package  
{  
import flash.display.MovieClip;  
import flash.events.Event;  
import flash.events.MouseEvent;  
import fl.controls.Button;

```
public class btnEffect extends MovieClip

{
	public function btnEffect()
	{
			this.buttonMode = true;
			this.addEventListener(MouseEvent.MOUSE_OVER, rollOn);
			this.addEventListener(MouseEvent.MOUSE_OUT, rollOff);
	}
	
	public function rollOn(event:MouseEvent):void
	{
		if (this.currentFrame &gt;= this.totalFrames) 
		{
           delete this.onEnterFrame;
   		} 
	   else 
	   {
          this.nextFrame(); 
       }
	
		//this.gotoAndStop(2);
	}
	
	public function rollOff(event:MouseEvent):void
	{
		this.gotoAndStop(1);
	}
}

```

}

I just started using AS3 and I am not all that familiar with the new updates to the code.  
I keep getting this error message.  
1119: Access of possibly undefined property onEnterFrame through a reference with static type btnEffect.
