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]