# XML and Preloader

**URL:** <https://forum.kirupa.com/t/xml-and-preloader/240602>\
**Category:** flash\
**Created:** [October 4, 2007, 12:10pm UTC](https://forum.kirupa.com/t/xml-and-preloader/240602 "2007-10-04T12:10:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fried](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@fried](https://forum.kirupa.com/u/fried)\
**Post date:** [October 4, 2007, 12:10pm UTC](https://forum.kirupa.com/t/xml-and-preloader/240602/1 "2007-10-04T12:10:35Z")

</div>

Hi there guys,

I have an XML object that loads all the necessary info to their respective places.

My problem is, i would like to create preloaders for the images, and I am using the movieClipLoader class. I have tried to declare a global variable outside the XML object, but this does not seem to work. Any help would be appreciated.

```auto

import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup( Shortcuts, PennerEasing, Fuse );

_global.pic1;

pic1Holder_mc._alpha = 0;

var teaser_xml:XML = new XML();
teaser_xml.ignoreWhite = true;
teaser_xml.onLoad = function(success){
	if(success){
		// ****//heading and summaries for specific stories//**** //
		//These are the main headlines and sub summaries for the
		//top story section of the teaser.
		heading1 = teaser_xml.firstChild.firstChild.firstChild.firstChild.nodeValue;
		summary1 = teaser_xml.firstChild.firstChild.firstChild.nextSibling.firstChild.nodeValue;
		
		heading2 = teaser_xml.firstChild.firstChild.nextSibling.firstChild.firstChild.nodeValue;
		summary2 = teaser_xml.firstChild.firstChild.nextSibling.firstChild.nextSibling.firstChild.nodeValue;
		
		heading3 = teaser_xml.firstChild.firstChild.nextSibling.nextSibling.firstChild.firstChild.nodeValue;
		summary3 = teaser_xml.firstChild.firstChild.nextSibling.nextSibling.firstChild.nextSibling.firstChild.nodeValue;
		
		heading4 = teaser_xml.firstChild.firstChild.nextSibling.nextSibling.nextSibling.firstChild.firstChild.nodeValue;
		summary4 = teaser_xml.firstChild.firstChild.nextSibling.nextSibling.nextSibling.firstChild.nextSibling.firstChild.nodeValue;
		
		storyBG_mc.summaryTxt.text = summary1;
		storyBG_mc.headingTxt.text = heading1;
		
		storyBG1_mc.summaryTxt.text = summary2;
		storyBG1_mc.headingTxt.text = heading2;
		
		storyBG2_mc.summaryTxt.text = summary3;
		storyBG2_mc.headingTxt.text = heading3;
		
		storyBG3_mc.summaryTxt.text = summary4;
		storyBG3_mc.headingTxt.text = heading4;
		// ****//This is the end of the headings and summaries being loaded//**** //
		
		
		// ****//Loading Images//**** //
		pic1 = teaser_xml.firstChild.firstChild.firstChild.nextSibling.nextSibling.firstChild
		pic1Holder_mc.loadMovie(pic1);
		return pic1;
		
		pic2 = teaser_xml.firstChild.firstChild.nextSibling.firstChild.nextSibling.nextSibling.firstChild
		pic2Holder_mc.loadMovie(pic2);
		
		//trace(pic2);
		
	
	}
}
teaser_xml.load("teaser.xml");

var loader:MovieClipLoader = new MovieClipLoader();
		loader.addListener(this);
		function onLoadInit(placeholder_mc:MovieClip) {
			pic1Holder_mc.alphaTo(100,1,"easeOutExpo");
		}
		function onLoadProgress(placeholder_mc:MovieClip, loaded:Number, total:Number) {
			var percent:Number = Math.floor(loaded/total*100);
			loader1_mc.pic1Loaded.text = "Pic1 " + percent;
		}
loader.loadClip(pic1, pic1Holder_mc);	

```
