# Calling a function2 from function1

**URL:** <https://forum.kirupa.com/t/calling-a-function2-from-function1/300104>\
**Category:** flash\
**Created:** [November 16, 2009, 9:48am UTC](https://forum.kirupa.com/t/calling-a-function2-from-function1/300104 "2009-11-16T09:48:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zystudios](https://avatars.discourse-cdn.com/v4/letter/z/edb3f5/32.png) [@zystudios](https://forum.kirupa.com/u/zystudios)\
**Post date:** [November 16, 2009, 9:48am UTC](https://forum.kirupa.com/t/calling-a-function2-from-function1/300104/1 "2009-11-16T09:48:18Z")

</div>

Trying to do a preloader by loading each file individually. When file1 is loaded, load file2… and so on.

I can get this script to work when testing in Flash but when testing locally through firefox it ceases to work.

After trying to preload with a few different scripts this one seemed the most simple and I still can’t get it to work. FED UP!!

here’s the script:

var sender:LocalConnection = new LocalConnection();  
var xmlFiles:XML = new XML();  
var initFile:Object = new Object();  
var myArray:Array = Array();  
this.createEmptyMovieClip(“empty”, 0);  
var mcLoader:MovieClipLoader = new MovieClipLoader();  
var listener:Object = new Object();  
var i:Number = -1;  
mcInside.\_visible = false;  
xmlFiles.onLoad = function() {  
loadXML();  
break;  
};  
function loadXML() {  
i++;  
trace(i);  
initFile.desc = (xmlFiles.firstChild.childNodes\*.childNodes[0].firstChild.nodeValue);  
myArray\* = initFile.desc;  
loadFiles();  
}  
function loadFiles() {  
this.createTextField(“mcText”,99,0,0,50,50);  
mcText.text = "\*\*_you";  
mcText.textColor = 0x000000;  
clearInterval(loadFilesvar);  
listener.onLoadInit = function() {  
loadXML();  
sender.send(“linksConnect”, “linksPopUp”);  
};  
thumbName = “mcThumb”+i;  
empty.attachMovie(“thumb”, thumbName, i, initFile);  
mcLoader.addListener(listener);  
 [//mcLoader.loadClip](https://mcLoader.loadClip)(myArray, empty[thumbName]);  
empty.loadMovie(myArray_);  
}  
xmlFiles.ignoreWhite = true;  
xmlFiles.load(“files.xml”);
