XML .. Loaded image onRelease

here’s my xml code … >
Why won’t my images activate the ‘trace’ function when I click them? The pictures load correctly, so everything else is ok …

xmlData = new XML();
xmlData.ignoreWhite = true;    
xmlData.load("links.xml");
xmlData.onLoad = LoadXML;
function LoadXML(ok)
{
    if(ok)
    {
        myFunction(this);
    }
    else
    {
        trace("Error with code");
    }
}

function myFunction(xmlData)
{
    xmlNode = xmlData.firstChild.childNodes;
    var cardTotal:Number = xmlNode.length;
    link = *;
    
    for (i=0;i<cardTotal;i++)
    {
        link* = xmlNode*.attributes.picture;
        _root.createEmptyMovieClip("link"+i+"_mc",i);
        _root["link"+i+"_mc"].loadMovie(link*);
        _root["link"+i+"_mc"].onRelease = function()
        {
            trace(link*);
        }
    }
}

thanks!!!

becouse they aint loaded yet.
please use the search function.
This question is in every 5th topic

I was hoping for someone to be a little more helpful. You shouldn’t have fallen for the trap which was stipulated in the title of the post, enabling you to be bugged by the same question again.

I just don’t understand why it hasn’t loaded yet. The images yes maybe - but the MovieClips that have been created to contain the images will have been invoked by that point … and thus should link to its according data. The XML data has been loaded.

I have tried searching the Kirupa help, and the XML gallery tutorial doesn’t help me with my eventual outcome …

Any other ideas folks! ? :slight_smile:

right now i tried to use the searchfunction but it didnt work

to correct this you need to load the mc’s with moviecliploader and use onloadinit() to apply functions to the mcs