1 Reply Latest reply on Mar 23, 2008 1:22 AM by Greg Dove

    Using 2 mc's to load xml images from the same file

    alanwallace4 Level 1
      Hi,
      Not sure if anyone can help me with this, or even if it can be done!
      What i would like to do is this.....

      i have 2 empty movie clips ("holder1_mc" and "holder2_mc")
      I also have a xml file with the following code -

      <?xml version="1.0" encoding="utf-8"?>
      <gallery>

      <image>
      <img>images/pic1.jpg</img>
      </image>
      <image>
      <img>images/pic2.jpg</img>
      </image>
      <image>
      <img>images/pic3.jpg</img>
      </image>

      </gallery>

      Now what i would like to do is load the first image into "holder1_mc" and then after 20 seconds or so have "holder2_mc" swap depths and load the next image in the xml file and so on until the last image is displayed and then the process is repeated.
      Any ideas on how i can do this. Or how i can help myself.
      Cheers
      Alan
        • 1. Re: Using 2 mc's to load xml images from the same file
          Greg Dove Level 4
          You can do that by 'chaining' the loading. Use MovieClipLoader to alternate into two different load targets. I would set it up so that you are loading into an empty childclip of an otherwise empty parent clip.
          Use the onLoadInit handler of the MovieClipLoader to a) set the parent clip to visible - see why in (b) - and do any positioning/scaling that may be necessary and b) load the next clip into the other loading target after setting its parent clips visibility to false....that way you can very likely display the image after 20 seconds because for most people it should have already loaded, instead of waiting for it to load. c) After the second clip has loaded, repeat the sequence, but from this point on its the 20 second timer (and display switching between the two target clips) that triggers b) to occur.

          Something like that anyway. Hope it helps.