# addEventListener... won't

**URL:** <https://forum.kirupa.com/t/addeventlistener-wont/281190>\
**Category:** Uncategorized\
**Created:** [February 5, 2009, 10:19pm UTC](https://forum.kirupa.com/t/addeventlistener-wont/281190 "2009-02-05T22:19:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuddhaPirate](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@BuddhaPirate](https://forum.kirupa.com/u/BuddhaPirate)\
**Post date:** [February 5, 2009, 10:19pm UTC](https://forum.kirupa.com/t/addeventlistener-wont/281190/1 "2009-02-05T22:19:48Z")

</div>

This is probably the simplest code in the world to get to work and I am at a frustrating loss as to why it is not. Here is my code:

```auto
var productLength = products_XML.*.length();
// trace (productLength);
        var p:Number = 0;
        
        for (p=1; p<productLength; p++) {

            var productNavi:navigation = new navigation();
                products_page.addChild (productNavi);
                productNavi.x = -360;
                productNavi.y = -150 + 65 * (p-1);
                
            //Populate Info
            var productsTitle="";
            var productsInfo ="";

            productsTitle = products_XML.*[p].title;
            productsInfo = products_XML.*[p].description;
            
            productNavi.navi_txt.htmlText = productsTitle;
            if (productNavi.navi_txt.numLines <= 1) {
                productNavi.navi_background.height = 25;
                productNavi.navi_txt.x += 5;
                productNavi.y += 11.5;
            }
            productNavi.info_txt = productsInfo;
            productNavi.heading_txt = productsTitle;
            
            productNavi.addEventListener(MouseEvent.CLICK, populateProducts);
        }

```

All of my variables are right, everything renders right, except that the buttons DO NOT HAVE EVENT LISTENERS. What is even more frustrating is I have almost exactly the same code earlier in my file and it works fine! Any and all help would be AMAZING.  
Thank you.
