# Difficulty loading images using loadMovie

**URL:** <https://forum.kirupa.com/t/difficulty-loading-images-using-loadmovie/162387>\
**Category:** flash\
**Created:** [September 12, 2005, 7:39pm UTC](https://forum.kirupa.com/t/difficulty-loading-images-using-loadmovie/162387 "2005-09-12T19:39:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developmental](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@developmental](https://forum.kirupa.com/u/developmental)\
**Post date:** [September 12, 2005, 7:39pm UTC](https://forum.kirupa.com/t/difficulty-loading-images-using-loadmovie/162387/1 "2005-09-12T19:39:02Z")

</div>

I am having difficulty loading images using variable names for images, and then loading the variable with loadMovie.

btn action:

p1\_btn.btn\_mc.onRelease = function() {  
if (!(\_root.image\_1=“01.jpg”)) {  
\_root.smiles\_image\_1 = “01.jpg”;  
\_root.smiles\_image\_2 = “02.jpg”;  
}  
\_parent.\_parent.mask.gotoAndPlay(2);

loader action:

this.\_parent.image\_mc.image\_1.loadMovie(\_root.smiles\_image\_1);  
this.\_parent.image\_mc.image\_2.loadMovie(\_root.smiles\_image\_2);  
this.onEnterFrame = function() {  
filesize = this.\_parent.image\_mc.image\_1.getBytesTotal();  
loaded = this.\_parent.image\_mc.image\_1.getBytesLoaded();  
loader.\_visible = true;  
if (loaded != filesize) {  
loader.load\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
loader.\_visible = false;  
if (mask.\_alpha\<99) {  
mask.\_alpha -= 10;  
}  
}  
};

–  
If anyone has any suggestions

files  
[.fla](http://130public.net/test_area/loading_images/loading_images.zip)  
[.swf](http://130public.net/test_area/loading_images/loading_images.swf)  
[.html](http://130public.net/test_area/loading_images/index.html)
