# Variables? help please!

**URL:** <https://forum.kirupa.com/t/variables-help-please/177486>\
**Category:** Uncategorized\
**Created:** [February 2, 2006, 10:45am UTC](https://forum.kirupa.com/t/variables-help-please/177486 "2006-02-02T10:45:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stushort](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@stushort](https://forum.kirupa.com/u/stushort)\
**Post date:** [February 2, 2006, 10:45am UTC](https://forum.kirupa.com/t/variables-help-please/177486/1 "2006-02-02T10:45:42Z")

</div>

I am trying to load external jpegs into dynamically created movie clips, the number of movie clips depends on the number of childNodes, the variable totalImages is being set to the correct number but I dont know why i cant use this variable later on to create the right number of movie clips, here is the code-

//load xml file  
images\_xml = new XML();  
images\_xml.onLoad = startImageViewer;  
images\_xml.load(“xml/images.xml”);  
images\_xml.ignoreWhite = true;

function startImageViewer(success) {  
if (success == true) {  
rootNode = images\_xml.firstChild;  
[COLOR=Red]totalImages[/COLOR] = rootNode.childNodes.length;  
firstImageNode = rootNode.firstChild;  
}  
}

for(i=0;i\<[COLOR=Red]totalImages[/COLOR];i++){  
\_root.createEmptyMovieClip(“holder”+i, 100+i);  
\_root[“holder”+i].\_x=i\*100;  
\_root[“holder”+i].\_y=100;  
}
