# Help please error 1180 and potentially null objects, ect

**URL:** <https://forum.kirupa.com/t/help-please-error-1180-and-potentially-null-objects-ect/329963>\
**Category:** Uncategorized\
**Created:** [November 12, 2012, 8:30pm UTC](https://forum.kirupa.com/t/help-please-error-1180-and-potentially-null-objects-ect/329963 "2012-11-12T20:30:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![epps](https://avatars.discourse-cdn.com/v4/letter/e/c89c15/32.png) [@epps](https://forum.kirupa.com/u/epps)\
**Post date:** [November 12, 2012, 8:30pm UTC](https://forum.kirupa.com/t/help-please-error-1180-and-potentially-null-objects-ect/329963/1 "2012-11-12T20:30:50Z")

</div>

Using this code I get these dreaded errors:  
Scene 1, Layer ‘Actions’, Frame 61, Line 5 1180: Call to a possibly undefined method Worm.  
and  
Scene 1, Layer ‘Actions’, Frame 61, Line 6 1180: Call to a possibly undefined method Killer.

I have the feeling I need to make classes and have separate .as files for worm and killer but am not sure if I can solve this problem without this as I am not sure how to make classes(I have very basic as3 understanding and am not trying to be lazy)

Is there something someone can suggest that I 1) learn how to make classes for these and a reference for info on that or 2) I don’t need to and its just something simple I am missing?

[AS]  
import flash.display.MovieClip;  
import flash.events.Event;

// instantiate Killer and Worm instances from the library  
var worm:MovieClip = new Worm();  
var killer:MovieClip = new Killer();

// position worm  
worm.x = 200;  
worm.y = -50;

// not sure where killer is supposed to be  
killer.x = stage.stageWidth/2 - killer.width/2;  
killer.y = stage.stageHeight/2 - killer.height/2;

// add killer and worm to the displaylist  
addChild(worm);  
addChild(killer);

var speed:Number = 5;  
var movement:Number = 5;

addEventListener(Event.ENTER\_FRAME, descent);

function descent(e:Event):void  
{  
worm.y += speed;

```
// worm exit test
if ( worm.y &gt;= 635 )
{
    removeEventListener(Event.ENTER_FRAME, descent);
}

// mouseX test
if ( mouseX &gt; worm.x + 5 )
{
    worm.x += movement;
}
else if (mouseX &lt; worm.x - 5)
{
    worm.x -= movement;
}
else
{
    worm.x = mouseX;
}

// worm collision test
if ( worm.hitTestObject(killer) )
{
    removeChild(worm);
    removeEventListener(Event.ENTER_FRAME, descent);
    gotoAndPlay(237);
}

```

}  
[/AS]

It is a game where the parachutes(falls down) and the player moves the mouse and the worm avoids hitting the fish(killer) and lands on the island winning the game. I had no problems getting the worm to listen to me and what it says in the code until I placed the hitTest in then I tried this approach of naming them movieclips…before my problem was they were null.  
Any help or suggestions would be much appreciated.
