# Can't access property of null object

**URL:** https://forum.kirupa.com/t/cant-access-property-of-null-object/289617
**Category:** Uncategorized
**Created:** [June 2, 2009, 3:10pm UTC](https://forum.kirupa.com/t/cant-access-property-of-null-object/289617 "2009-06-02T15:10:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![simply](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@simply](https://forum.kirupa.com/u/simply)
#### Post date: [June 2, 2009, 3:10pm UTC](https://forum.kirupa.com/t/cant-access-property-of-null-object/289617/1 "2009-06-02T15:10:45Z")

</div>

hey guys. I need your help please.  
i am pretty sure i am doing something wrong. just donno what it is.

i have frame HOME.  
above this frame i have a code for the buttons more003 and more004.

more004 is on frame called HUMAN.

when i preview is get the error 1009: Can’t access…

## here is the AS:

[COLOR=“Red”]more003.addEventListener(MouseEvent.CLICK,klik3);  
more004.addEventListener(MouseEvent.CLICK,klik4);

function klik3(event:MouseEvent):void {  
makePopUp3();  
};  
function klik4(event:MouseEvent):void {  
makePopUp4();  
};

function makePopUp3() {

```
var popupMc:PopUp = new PopUp();
popupMc.x = 10;
popupMc.y = 10;
popupMc.name = "popup";
TransitionManager.start(popupMc,{type:Fade, direction:Transition.IN, duration:0.2, easing:Strong.easeIn});
addChild(popupMc);
loadTxt3();
popupMc.popClose.addEventListener(MouseEvent.CLICK,Close);

```

};  
function makePopUp4() {

```
var popupMc:PopUp = new PopUp();
popupMc.x = 10;
popupMc.y = 10;
popupMc.name = "popup";
TransitionManager.start(popupMc,{type:Fade, direction:Transition.IN, duration:0.2, easing:Strong.easeIn});
addChild(popupMc);
loadTxt4();
popupMc.popClose.addEventListener(MouseEvent.CLICK,Close);

```

};  
///  
function Close(e:Event) {  
removeChild(e.currentTarget.parent);  
};

function loadTxt3() {

```
var fileAdres:URLRequest = new URLRequest("Txt/Home/Students.txt");

var loader:URLLoader = new URLLoader(fileAdres);

fileAdres.method=URLRequestMethod.POST;
loader.dataFormat=URLLoaderDataFormat.TEXT;

loader.addEventListener(Event.COMPLETE,textLoaded);

```

};  
function loadTxt4() {

```
var fileAdres:URLRequest = new URLRequest("Txt/Human/Course.txt");

var loader:URLLoader = new URLLoader(fileAdres);

fileAdres.method=URLRequestMethod.POST;
loader.dataFormat=URLLoaderDataFormat.TEXT;

loader.addEventListener(Event.COMPLETE,textLoaded);

```

};  
//  
function textLoaded(event:Event):void {

```
var loader:URLLoader = URLLoader(event.target);

var txt:String = loader.data;

PopUp(getChildByName("popup")).field.htmlText=loader.data;

```

};[/COLOR]

* * *

hope u can understand.

can anyone help me please?..
