# Dynamically loaded jpgs won't unload in new frames

**URL:** https://forum.kirupa.com/t/dynamically-loaded-jpgs-wont-unload-in-new-frames/216703
**Category:** Uncategorized
**Created:** [February 19, 2007, 8:31pm UTC](https://forum.kirupa.com/t/dynamically-loaded-jpgs-wont-unload-in-new-frames/216703 "2007-02-19T20:31:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mauphie](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mauphie/32/3328_2.png) [@mauphie](https://forum.kirupa.com/u/mauphie)
#### Post date: [February 19, 2007, 8:31pm UTC](https://forum.kirupa.com/t/dynamically-loaded-jpgs-wont-unload-in-new-frames/216703/1 "2007-02-19T20:31:22Z")

</div>

Hello,  
This is my first posting and I’m fairly new at Flash. I’ve searched elsewhere for an answer to this question, but nothing’s helped. Perhaps someone will have an answer here?

I am creating dynamically loaded thumbnails in Frame 10. These load perfectly. But when I click on a button to go to a Frame 5 the thumbnails still appear. I’ve tried unloadMovie but it doesn’t work. What am I doing wrong?

Below is the ActionScript for the thumbnails.

mydata=new XML;  
mydata.ignoreWhite=true;  
mydata.load(“datahome.xml”);  
mydata.onLoad=dosomething;

function dosomething(success) {  
if (success) {

```
	showinfo(0);
	
	originalx=180;
	originaly=90;
	currentx=originalx;
	currenty=originaly;
	
// Create thumbnails

	for (i=0; i&lt;5; i++) {
	_root.attachMovie("thumbnailmovie", "thumbnail1" +i , 10000+i);
	_root["thumbnail1" +i].thumbnailname=mydata.firstChild.childNodes[0].childNodes[5].childNodes*.firstChild.nodeValue;
	_root["thumbnail1" +i].itemnumber=i;
	_root["thumbnail1" +i]._x=currentx;
	_root["thumbnail1" +i]._y=currenty;
	currenty+=75;
	}
}

```

}
