This content has been marked as final. Show 6 replies
well this seems an odd question but ... if you have all of the images within the file, why are you using xml?
you could just place the image linkage names within the array, and then use a method to attach them to the Stage when the 'next' or 'back' buttons are pressed (I think that's what your trying to do) or on an interval timer.
is that kind of what you're looking for?
Thanks for the super speedy response!
No, all the images are external. Therein lies the problem otherwise I admit it would be simpler. There are a few images and I wanted to use XML for obvious reasons - update pictures, movie size - usual stuff.
The slide show changes automatically and has the usual backwards and forwards buttons.
I thought I could do something simple like 'if (childNodes.nodeName = something)'...
But I'm looking at setting up another array to store the XML details and which point I've got lost.
Any pointers greatly appreciated!
ok - what you need to do here is to 'iterate' through the xml return, and gather the address to the files. you will not be able to use the attachMovie method, you will need to use the MovieClipLoader class to load the external images into MCs that you create dynamically. you can do much of this within the xml onLoad handler. just for starters...
I really appreciate that...fantastic,
but if I've got it right isn't the code just rendering my images dynamically now as movie clips on the stage - what I want to do is attach new animations to the stage based on which slide I'm displaying in my movie from the XML.
You must forgive me if this is what the script is doing, but to my untrained eyes it looks like it's assigning each slide (each image) as an MC.
very good, you are correct that's exactly what it's doing, as well as 'centering' the images on an open stage. what you can do then is target a movieclip instance to load the dynamic instances into (just like what it's doing but in another container you can control to positioning of) and then if you wish to attach a MC from the Lib use the runShow() method to do so and the 'index' value to pull the corresponding clip.
to do so, create another array and type in the linkage identifier name of the clips from the Lib in the order that corresponds to the images being loaded. now if you want to use the XML doc to 'store' the list of MCs to call in another node or attribute, you could do that too - you would then just need to add another element to the load loop in the onLoad handler, get the value from the correct node, and push it into a different array.
I understand the need to create the array with the movieclip identifiers - that makes sense, but what am I pulling from the existing code to trigger this - what part of the code monitors the iteration through the XML - put it in laymens terms I don't understand how to 'link' the two processes.
Do I have to create an if/else statement as part of the runShow () function. How does flash know which node of the XML tree I'm on in order to pull the correct movie from the library ? We can load in the images but how does flash know which image is which.
Is it just done sequentially through the for loop?
As you can see I'm guessing just a little bit. Any further help aapreciated - if you have pointers to go back to some basics to see what I'm missing let me know.
Also at the moment I might find it tricky to incorporate this into my existing code - but I'll work with yours until I'm pulling the movies from the library!