# Loading movies

**URL:** https://forum.kirupa.com/t/loading-movies/152269
**Category:** Uncategorized
**Created:** [June 22, 2005, 3:00pm UTC](https://forum.kirupa.com/t/loading-movies/152269 "2005-06-22T15:00:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![drose429](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/drose429/32/202_2.png) [@drose429](https://forum.kirupa.com/u/drose429)
#### Post date: [June 22, 2005, 3:00pm UTC](https://forum.kirupa.com/t/loading-movies/152269/1 "2005-06-22T15:00:45Z")

</div>

Hi  
I have created a flash movie with a movieclip (content\_mc) with a number of empty moviclips sitting along its timeline (red\_mc, green\_mc etc)  
I am trying to randomaly load images and then play the movie so tha the images play as an animation. The images load into the individual movieclips but then as you advance to the next movieclip the previous one vanishes. so the animation dosent work beccause you can only see the last loaded image  
Is it my lack of understanding of how moviclips work that is causing the problem. Here is the code I am using

var i = 0;  
red\_btn.onRelease = function() {  
filename = [“Tone0001.jpg”, “Tone0002.jpg”, “Tone0003.jpg”, “Tone0004.jpg”, “Tone0005.jpg”, “Tone0006.jpg”, “Tone0007.jpg”, “Tone0008.jpg”, “Tone0009.jpg”];  
path = “Theame1/”;  
f = filename.length;  
k = Math.floor(Math.random()\*f);  
i++;  
if (i == 1) {  
\_root.content\_mc.nextFrame();  
loadMovie(path+filename[k], \_root.content\_mc.red\_mc);  
}  
if (i == 2) {  
\_root.content\_mc.nextFrame();  
loadMovie(path+filename[k], \_root.content\_mc.green\_mc);  
}  
trace(i);  
};
