# onEnterFrame = null?

**URL:** <https://forum.kirupa.com/t/onenterframe-null/107380>\
**Category:** Uncategorized\
**Created:** [April 14, 2004, 8:44pm UTC](https://forum.kirupa.com/t/onenterframe-null/107380 "2004-04-14T20:44:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![angerbeaver](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@angerbeaver](https://forum.kirupa.com/u/angerbeaver)\
**Post date:** [April 14, 2004, 8:44pm UTC](https://forum.kirupa.com/t/onenterframe-null/107380/1 "2004-04-14T20:44:49Z")

</div>

I am using a function for a simple pacman game (im new to flash and i wanna try to make the game and refine it as i get better)…the function makes the onEnterFrame for the ghost null and when the dead\_ghost\_mc gets to the originating .\_x and .\_y it will make the onEnterFrame accesible again. My problem is once the onEnterFrame is made null i can never get it back.

this is my code so far:

//green eatable is assigned a 1 when pacman eats green\_ghost\_mc  
//green\_ghost\_dead\_mc is the movie clip that turns to eyes and finds  
//its way back to the starting coordinates.  
//once at the starting coordiantes the original ghost returns  
[color=#003366]green\_ghost\_dead\_mc.onEnterFrame = function()  
{  
if(green\_eatable == 1)  
{  
green\_ghost\_mc.onEnterFrame = null;  
if(green\_ghost\_dead\_mc.\_x \> 309)  
{  
green\_ghost\_dead.\_x–;  
}  
else  
{  
if(green\_ghost\_dead\_mc.\_x \< 308)  
{  
green\_ghost\_dead.\_x++;  
}  
else  
{  
green\_ghost\_dead\_mc.\_x = 308.7;  
}  
}  
if(green\_ghost\_dead\_mc.\_y \> 204)  
{  
green\_ghost\_dead\_mc.\_y–;  
}  
else  
{  
if(green\_ghost\_dead\_mc.\_y \< 203)  
{  
green\_ghost\_dead\_mc.\_y++;  
}  
else  
{  
green\_ghost\_dead\_mc.\_y = 203.15;  
green\_eatable = 0;  
green\_ghost\_mc.onEnterFrame; //how do i make this accesible?[/color][color=#003366]  
}  
}  
}[/color]  
[color=#003366]}[/color]
