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:
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.