Loading jpgs

Hi !

I’ve tried several tutorials on loading JPGs and none have worked for me. I have a huge project and have included snippets of code to show what I’m trying to do. I’m essentially, reading in an XML file containing an ID, a jpg filename, and an X/Y coordinate for placing the jpgs. Thes jpg files are 20x20 pixels in size and are being placed at different levels in a movie clip called “icons” I’ve used this similar technique to duplicate and display movieclips named “dot” in another section of my code in another movieclip and that works fine.

_root.mapholder.map.createEmptyMovieClip(“icons”, 1048563);

// read in XML, set idStr, iconPath, point.x, point.y and displayJPG () to display icons…
displayJPG( idStr, iconPath, dotN, point);
dotN++;
//…

function displayJPG( idStr:String, iconPath:String, dotN:Number, point:Object)
{
_root.mapholder.map.icons.createEmptyMovieClip( idStr, dotN);
with( _root.mapholder.map.icons[idStr]) {
_x = point.x + posX;
_y = point.y + posY;
}
_root.mapholder.map.icons[idStr].loadMovie( iconPath);
}

Thanks,
Tracey