4 Replies Latest reply on Sep 25, 2006 5:08 AM by TimSymons

    xml component -news/image gallery HELP

    niietzshe
      Hello As experts ;)
      I am new to Flash (about 2 days) but have intermediate programming experience in MEL.
      I am trying to create a projects page for my site, which consists of a banner per project, it then takes you into an article on the creation of the project...

      Each banner has an image, a date, a title and a description.
      Using the xml connector and various label/image loader components I've pulled everything in I need.

      What I need some kind help with is now how to set it up so I have one movie clip thats a template for the banner. then it loads the xml data into the banner, if there is meant to be 2 banners for instance, duplicate the movie clip and put the second lot of info into that banner (the flow of the banners should go from bottom to top, so the first one would be knocked down and the second should become the topmost one.)

      Hopefully I want to send up with a window with banners cascading down (with scroll bar) and when I want to add a new one, add the relevant info into xml and it will create the new one in flash...

      If anyone can give me idiotproof adivice that would be great, this is boggling my head at the moment.
      thanks
      christian
        • 1. Re: xml component -news/image gallery HELP
          TimSymons Level 1
          Christian,

          I do similar stuff with XML so I will describe my method but it will not necessarily be the only way to do this.

          1. Use the XML class and load in your XML file will all of your information.
          2. Setup a starting _y position variable
          3. Create a loop to loop through each node of your xml file.
          4. For each main node in your XML file attach the template from your library to the movieclip that will contain all of your pieces.
          5. Perform all of the necessary steps to populate your banner.
          6. Position your new banner movieclip on the stage using your starting _y position.
          7. Update the starting _y position by adding to it the _height of your current banner ( you may also want to add a few more pixels to it for spacing.
          8. continue with the next node in the loop.

          Is this enouh to get you started or do you need a more complete example?

          Tim
          • 2. Re: xml component -news/image gallery HELP
            niietzshe Level 1
            Boom, nice answer.
            Yeah this explains to me perfectly what to do, thanks for that!!!
            I however don't know how to set this loop up, I'm sure I can bug some people about it and get an answer off them, at least I know where to start now. I guess it makes sense, I can't believe I didn't think about it.

            If you have any more info for me on how to setup the looping action, could you email me:
            *My Email Address

            I could send you my file to check out then, an old school as scripter friend of mine can help, but he used to get xml in the old way, not using the xml connector component...

            Later
            Christian
            • 3. Re: xml component -news/image gallery HELP
              niietzshe Level 1
              I still haven't figured this out yet, Can anyone help me out a bit more thuroughly??
              Cheers
              Christian
              • 4. Re: xml component -news/image gallery HELP
                TimSymons Level 1
                Christian,

                Are you using the Component Inspector to bind the resutls from the XMLConnector to the other components? If you are, then I do not know how to loop through the XML and keep those bindings. But...if you don't mind storing the results from the XMLConnector into an XML variable and then using the XML and XMLNode class methods, I can help you with that.

                You can e-mail me directly at: Tim Symons

                Tim