Loading the first image...(NOT a preload Q!)


Having got the bulk of my site to work - I seem unable to get the AS to work in loading the first image.
The main script runs after a button has been pressed, but how do I get the following script to execute after the XML file (called pictures) has been loaded. I have tried lots of different ways - onenterframe, frame loaded etcbut none seem to work


Is there a simple answer to this? - I hope so:)


yes, there is a very simple answer. This is how I load all my XML files.

[AS]my_XML = new XML();
my_XML.ignoreWhite = true;

// IMPORTANT PART FOR YOU ////////////

my_XML.onLoad = function(success) {
if (success) {


Thanks - it works! I have been able to load my first image…BUT I can not understand why the preloader I am using does not work(it works in the rest of the site when a button is pressed). If I have the following script as follows - the image loads - but the loadbar does not work:


pictures = new XML();
pictures.ignoreWhite = true;

pictures.onLoad = function(success) {
if (success) {
this.createEmptyMovieClip(“preloader”, 1000);
picture._visible = 0;
preloader.onEnterFrame = function() {
var l = picture.getBytesLoaded();
var t = picture.getBytesTotal();
var getPercent = l/t;
loadBar._width = getPercent*100;
if (l>0 && l>=t) {
picture._visible = 0;


Why does the preloader loop not work(and yes I know I said in my thread title that this was not a preloader question - as I thought I had a script that worked!)??