# Loading jpgs

**URL:** https://forum.kirupa.com/t/loading-jpgs/157025
**Category:** Uncategorized
**Created:** [July 29, 2005, 2:08pm UTC](https://forum.kirupa.com/t/loading-jpgs/157025 "2005-07-29T14:08:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![threedfx1](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@threedfx1](https://forum.kirupa.com/u/threedfx1)
#### Post date: [July 29, 2005, 2:08pm UTC](https://forum.kirupa.com/t/loading-jpgs/157025/1 "2005-07-29T14:08:53Z")

</div>

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
