# Help please!

**URL:** <https://forum.kirupa.com/t/help-please/310173>\
**Category:** Uncategorized\
**Created:** [June 3, 2010, 10:59am UTC](https://forum.kirupa.com/t/help-please/310173 "2010-06-03T10:59:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![orikay](https://avatars.discourse-cdn.com/v4/letter/o/a88e57/32.png) [@orikay](https://forum.kirupa.com/u/orikay)\
**Post date:** [June 3, 2010, 10:59am UTC](https://forum.kirupa.com/t/help-please/310173/1 "2010-06-03T10:59:27Z")

</div>

I have a project due in a week, and I’m lost! :\*(  
I’m having a lot of troubles with action script since most of the project is based on self learning. :puzzled:

Part of the project is a game attached to an interactive representation of the blood components for children (it’s a very minimal representation).  
The game consists of 4 objects, one of them is player controlled (WCell), and the other 3 are supposed to randomly fall -top to bottom-, the player gets points for “eating” the correct object(germs), and loses points for eating the wrong objects(tasiyot\_MC & RCell\_mc).

## I’m attaching the code (also zipped fla file) here, hoping that someone in this huge forum could help me find out why am I receiving this error:

## TypeError: Error #1010: A term is undefined and has no properties. at MethodInfo-2() :ponder:

Thank you much in advance! 😃

//beginning----------------------------------------

var score:Number=0;  
this.dyna.text=String(score);  
//score textbox--------------

var xrand:Number=Math.round(Math.random()_(540-1)+1);  
//Random x positioning-----------------------------------  
var yrand:Number=Math.round(Math.random()_(5-1)+1);  
//Random fall speed--------------------------------------

but1.addEventListener(MouseEvent.CLICK,global);  
//start game-----------------------------------------  
function global(event:MouseEvent):void {  
if (score==200) {  
this.instr.visible=true;  
this.instr.text=“YOU WIN”;  
stop();  
//winning msg and stop-----------------------------  
} else {

this.instr.visible=false;  
//hide instructions textbox

stage.addEventListener(KeyboardEvent.KEY\_DOWN,Move WCell);  
//move the white cell listener----------------------------

germs.addEventListener(Event.ENTER\_FRAME,fall);  
//call the top to bottom objects fall-----------

RCell\_mc.addEventListener(Event.ENTER\_FRAME,fall);  
//call the top to bottom objects fall--------------

tasiyot\_MC.addEventListener(Event.ENTER\_FRAME,fall );  
//call the top to bottom objects fall-----------------

function fall(event:Event):void {  
//top to bottom fall-loop start---------------------------  
this.RCell\_mc.y=yrand;  
if (this.RCell\_mc.y\>399) {  
this.RCell\_mc.x==xrand;  
this.RCell\_mc.y==0;  
//top to bottom object fall-loop------------------  
}

this.tasiyot\_MC.y=yrand;  
if (this.tasiyot\_MC.y\>399) {  
this.tasiyot\_MC.y==0;  
this.tasiyot\_MC.x==xrand;  
//top to bottom object fall-loop--------  
}

this.germs.y=yrand;  
if (this.germs.y\>399) {  
this.germs.x==xrand;  
this.germs.y==0;  
//top to bottom object fall-loop------  
}

if (germs.hitTestObject(WCell\_MC)) {  
//when player hits objects----------------------  
germs.x==xrand;  
germs.y==0;  
score=score+5;  
this.dyna.text==""+score;  
}

if (RCell\_mc.hitTestObject(WCell\_MC)) {  
//when player hits objects----------------------  
RCell\_mc.y==0;  
RCell\_mc.x==xrand;  
score=score-3;  
this.dyna.text==""+score;  
}

if (tasiyot\_MC.hitTestObject(WCell\_MC)) {  
//when player hits objects----------------------  
tasiyot\_MC.y==0;  
tasiyot\_MC.x==xrand;  
score=score-3;  
this.dyna.text==""+score;  
}  
}

function MoveWCell(event:KeyboardEvent):void {  
//MOVE THE WHITE BLOOD CELL START-----------------------------------------  
switch (event.keyCode) {  
case Keyboard.RIGHT :  
//MOVE THE WHITE BLOOD CELL----  
WCell\_MC.x==WCell\_MC.x+5;  
break;  
case Keyboard.LEFT :  
//MOVE THE WHITE BLOOD CELL----  
WCell\_MC.x==WCell\_MC.x-5;  
break;  
}  
if (WCell\_MC.x\<0) {  
//CONSTRICT WHITE CELL TO STAGE-------------------------------------------  
WCell\_MC.x==0;  
}

if (WCell\_MC.x\>550) {  
//CONSTRICT WHITE CELL TO STAGE-------------------------------------------  
WCell\_MC.x==550;  
}  
}  
}  
}  
//END---------------------------------------------------------------
