# Inconsistent referencing behaviour

**URL:** <https://forum.kirupa.com/t/inconsistent-referencing-behaviour/252839>\
**Category:** flash\
**Created:** [February 24, 2008, 9:44am UTC](https://forum.kirupa.com/t/inconsistent-referencing-behaviour/252839 "2008-02-24T09:44:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbx33](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@cbx33](https://forum.kirupa.com/u/cbx33)\
**Post date:** [February 24, 2008, 9:44am UTC](https://forum.kirupa.com/t/inconsistent-referencing-behaviour/252839/1 "2008-02-24T09:44:17Z")

</div>

Can any one tell me why the listenerevent functions seem to be inconsistent. The second one works. The first one doesn’t, complaining about a NULL parameter being passed to navigateToURL. I used to have the links in an array, and as you can see by my commented out code, I wanted to loop this. Any help here?

```auto
var links1 = new URLRequest("link1.html");
var links2 = new URLRequest("link2.html");
var links3 = new URLRequest("link3.html");
var links4 = new URLRequest("link4.html");

//for (y=1;y<=(numbut/2);y++)
//{
// this["btnr"+y].addEventListener(MouseEvent.CLICK, function (){navigateToURL(links1, '_self')});
// this["btnr"+(y+(numbut/2))].addEventListener(MouseEvent.CLICK, function (){navigateToURL(links1, '_self')});
//}    
    this["btnr1"].addEventListener(MouseEvent.CLICK, function (){navigateToURL(this["links"+1], '_self')});
    this["btnr5"].addEventListener(MouseEvent.CLICK, function (){navigateToURL(links1, '_self')});

```
