# Loaded swf preloader issues

**URL:** https://forum.kirupa.com/t/loaded-swf-preloader-issues/203013
**Category:** flash
**Created:** [October 6, 2006, 3:35pm UTC](https://forum.kirupa.com/t/loaded-swf-preloader-issues/203013 "2006-10-06T15:35:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rewind](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@rewind](https://forum.kirupa.com/u/rewind)
#### Post date: [October 6, 2006, 3:35pm UTC](https://forum.kirupa.com/t/loaded-swf-preloader-issues/203013/1 "2006-10-06T15:35:53Z")

</div>

Hi all,  
Am loading separate swfs for each separate gallery at my test site [here](http://www.lonnyspence.com/test.htm).

I have a few issues as follows:

1. How to remove the slight flicker as the preloader starts?

2. How to set the preloader to only load once? The preloader doesn’t use the normal two-frame setup so am not sure how to get it to recognise the movie is cached. Here’s the first bit of AS in the loaded swf:

[AS]stop();  
function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
}  
id = setInterval(preloadPic, 1);  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“gallery1.xml”);  
var loadTot = 0;  
var k = 0;  
//////////////////////////////////////  
function preloadPic() {  
clearInterval(id);  
var con = picture.duplicateMovieClip(“con”+k, 9984+k);  
con.loadMovie(image[k]);  
var temp = \_root.createEmptyMovieClip(“temp”+k, 99+k);  
temp.onEnterFrame = function() {  
var total = con.getBytesTotal();  
var loaded = con.getBytesLoaded();  
percent = Math.round((loaded/total\*100)/image.length);  
preloadbar\_mc.\_xscale = loadTot+percent;  
info.text = “Loading picture “+k+” of “+image.length+” total”;  
if (loaded == total && total\>4) {  
con.\_visible = 0;  
nextPic();  
loadTot += percent;  
delete this.onEnterFrame;  
}  
};  
}[/AS]

1. Am trying to get a text box with the loding percentage moving along with the edge of the loading bar.

Any help with any of these issues much appreciated.
