Dynamic Menu and Loader Settings

Hello,

I am sure this has been asked before, but I just couldn’t find a thread that really answers my question.

I am creating a dynamically built menu from an array of image titles and images on the server, by using the attachMovie function and attaching a movieclip. (The whole code is based on a tutorial from this site)

Changing the text of the menu item works fine.

But I cant get the icon next to the text to load the image.

Here is the code:

[FONT=Courier New]GenerateMenu = function(container, name, x, y, depth ) {
// variable declarations
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);

// for all items or XML nodes (items and menus)
// within this node_xml passed for this menu
for (var i=0; i<title_array.length; i++) {
    // movieclip for each menu item
    curr_item = curr_menu.attachMovie("M_NewsMenuItem","item"+i+"_mc", i);
    curr_item._x = x;
    curr_item._y = y + i*curr_item._height;
    curr_item.trackAsMenu = true;
    
    // item properties assigned from the array
    curr_item.name.text = title_array*;
    curr_item.test.contentPath = "pics/test.jpg";
    curr_item.test.load();  // I switched the component to autoLoad false

} // end for loop

};[/FONT]

Thanks for any help!