FORUMS: list search recent posts

preloader ordering

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark Moser
preloader ordering
on Jan 17, 2009 at 4:01:40 pm

Hi, I'm piecing together elements form several tutorials on various sites to make my own xml based slideshow with linkable images. It is working great except that I am not able to control the order in which the images are loaded. They get loaded in the order they are downloaded, not in the order of my XML file. This is this is causing the links, and other attributes I'm putting in my xml doc, to fall out of sync.

I assume there is a way to either push my items in a specific order, or make sure the extra attributes are loaded at the time that imaged is pushed into the array. I guess some context would help:

var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load(_root.xmlPath + "scroller.xml");

_root.lnks = [];
_root.titles = [];

myShowXML.onLoad = function() {
_root.myWidth = myShowXML.firstChild.attributes.width;
_root.myHeight = myShowXML.firstChild.attributes.height;
_root.mySpeed = myShowXML.firstChild.attributes.speed;
_root.myImages = myShowXML.firstChild.childNodes;
_root.myImagesNo = myImages.length;
_root.target_mc = 0;
navLink(); // function adds a getURL(_root.lnks[_root.target_mc]);
navNext(); // function triggers an advance in the slideshow
navPrev(); // function triggers an rewind in the slideshow

function createContainer() {
myContainer_mc._x = 0;
myContainer_mc._y = 0;

function callImages() {
_root.myMCL = new MovieClipLoader();
_root.myPreloader = new Object();
_root.myClips_array = [];
_root.myPreloader.onLoadComplete = function(target) {
//make sure only the first image is visible
if (_root.myClips_array.length > 1){target._alpha=0;}

// append the attributes to each loaded image
for (i=0; i<_root.myImagesNo; i++) {
temp_img = _root.xmlPath + _root.myImages[i].attributes.img;
_root.lnks[i] = _root.myImages[i].attributes.lnk;
_root.titles[i] = _root.myImages[i].attributes.title;
temp_mc = myContainer_mc.createEmptyMovieClip(i, myContainer_mc.getNextHighestDepth());
_root.myShowInt = setInterval(moveSlide, (_root.mySpeed*1000),4);

I think I've provided all the relevant information, but if you need to see another function just let me know.

Again, everything loads just fine when I test locally, its just that the order is off sync when I'm actually downloading the items. The heavier images get moved to the back, while those atributes are in the correct order.

I would really prefer to keep the images in the order of the XML doc, but if that isn't possible I need to at least be able to make sure the attribute values are assigned to the proper image container. I'm not sure where and how.

thanks in advance!
-- MMoser

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved