I’ve been trying to customize the photo gallery tut to incorporate an xml doc. (I’ve looked at the macromedia xml gallery tut but I would like my pics to fade in and out).
My question is:
How can I make my image array available to the other code functions if it is created within an initial xml function, rather than as a global list?
i.e.
function startSlideshow(){
this.pArray = new Array();
for(i = 0; i < root.childNodes.length; i++){
this.pArray* = root.childNodes*.attributes.src;
}
}
*Originally posted by new2mx * How can I make my image array available to the other code functions if it is created within an initial xml function, rather than as a global list?
I don’t understand the question. Do you have problems parsing the data, putting it in the array or is it something else?
I have the array from the xml, but because it is made within a function, when I click the next button to forward the slideshow the ‘changePhoto’, ‘loadPhoto’ and other functions don’t know that an array exists.
In the original tut, the image array is made outside a function so the array and so its contents exists globally to all functions.
My problem is making the image array and its contents available to the ‘changePhoto’, ‘loadPhoto’, etc. functions. I think this is an array parsing problem like you suggested.
Hope this makes more sense, if not please let me know and I’ll post code.
Happily the prob was one of those stoopid typo things. Just needed to reference the array in the right way (was this.pArray, just needed to be pArray).
Thanks again tho for replying, ilyaslamasse. Cheers.
I was wondering: could you post your flash file, and the XML file, or at least the structure or the code? I’d like to have a look at it. If it’s not too much trouble or confidential, of course…
By the way, you had an error with your array because if you use this.pArray, the keyword this. makes the array relative to the object that calls the function, here your XML object. That’s why it wasn’t were it was supposed to be: in the _root.
Cheers! (could you rate this thread please?)
pom :asian:
Creating engaging and entertaining content for designers and developers since 1998.