# AS roll over menu

**URL:** https://forum.kirupa.com/t/as-roll-over-menu/188904
**Category:** flash
**Created:** [May 11, 2006, 6:10pm UTC](https://forum.kirupa.com/t/as-roll-over-menu/188904 "2006-05-11T18:10:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ryan\_imart](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@ryan\_imart](https://forum.kirupa.com/u/ryan_imart)
#### Post date: [May 11, 2006, 6:10pm UTC](https://forum.kirupa.com/t/as-roll-over-menu/188904/1 "2006-05-11T18:10:25Z")

</div>

```auto
class com.nutrilite.nt_mc_controller extends MovieClip{
 
 function nt_mc_controller(){
  trace("Initializing: " + this);
  this.initControls();
 }
 
 private function initControls(){
  this.stop()
  this.onRollOver = function(){   
   _global.activeMenu = this;
   this.isMouseOver = true;
   // If we're currently in an interval then don't start another
   if(this.intCheck == 0){
    this.intCheck = setInterval(this.rollOverCheck, 5, this);
    gotoAndPlay("drop");
    trace("roll over: " + this);  
   } 
  }
  
  this.onRollOut = function(){
   trace("roll out: " + this);  
   this.gotoAndStop("1");    
  }
  
  this.onReleaseOutside = function(){
   trace("release outside: " + this);  
   this.gotoAndStop("1");     
  }
  this.onRelease = function(){
   trace("release: " + this);   
  }
 }
 
   
 
 function rollOverCheck(objRef){
   
   var isMouseOver:Boolean;
   var intCheck:Number = 0;
   var testCount:Number = 0;
   
   if(isMouseOver == false){
   this.testCount++;
   // Let the check function run twice before clearing the menu
   if(this.testCount == 2){
    this.clearInterval(this.intCheck);
    this.intcheck = 0;
    this.testCount = 0;
    // Visual reset
    this.gotoAndStop("1");
    if(_global.activeMenu == objRef){
     trace("closing event");
    }
   }
  }else{
   this.testCount = 0;
  }
 }
 
}

```

error:

E:\iMart\FLASH\NUTRILITE  
t\_mc\_homepage.fla:  
**Error** E:\iMart\FLASH\NUTRILITE\com  
utrilite  
t\_mc\_controller.as: Line 46: There is no property with the name ‘testCount’.  
this.testCount++;  
**Error** E:\iMart\FLASH\NUTRILITE\com  
utrilite  
t\_mc\_controller.as: Line 48: There is no property with the name ‘testCount’.  
if(this.testCount == 2){  
**Error** E:\iMart\FLASH\NUTRILITE\com  
utrilite  
t\_mc\_controller.as: Line 49: There is no method with the name ‘clearInterval’.  
this.clearInterval(this.intCheck);  
**Error** E:\iMart\FLASH\NUTRILITE\com  
utrilite  
t\_mc\_controller.as: Line 50: There is no property with the name ‘intcheck’.  
this.intcheck = 0;  
**Error** E:\iMart\FLASH\NUTRILITE\com  
utrilite  
t\_mc\_controller.as: Line 51: There is no property with the name ‘testCount’.  
this.testCount = 0;  
**Error** E:\iMart\FLASH\NUTRILITE\com  
utrilite  
t\_mc\_controller.as: Line 59: There is no property with the name ‘testCount’.  
this.testCount = 0;  
Total ActionScript Errors: 6 Reported Errors: 6

wtf mate? :x help!
