3 Replies Latest reply on Feb 22, 2009 11:02 AM by Newsgroup_User

    Any way I can OOP this?

    robbyk87 Level 1
      Hey all,

      Is there a way I can OOP this so I do not have to create another button set the source and create multiple http services?

      Surely there must! But alas, I am at a loss here.

      Basically if I needed to add more images - I would have to create more and more http services as well as all the 'like' commands for the image button.

      Anyway around this?

      Many thanks!

      Code below:
        • 1. Re: Any way I can OOP this?
          Level 7

          "robbyk87" <webforumsuser@macromedia.com> wrote in message
          news:gnrl9a$pfr$1@forums.macromedia.com...
          > Hey all,
          >
          > Is there a way I can OOP this so I do not have to create another button
          > set
          > the source and create multiple http services?
          >
          > Surely there must! But alas, I am at a loss here.
          >
          > Basically if I needed to add more images - I would have to create more and
          > more http services as well as all the 'like' commands for the image
          > button.

          I'm not sure what you mean by the "like" commands, but if you just use a
          repeater to repeat your buttons and use ONE HTTPService that looks at what
          index the button that was clicked is in the repeater list and sends based on
          that, I'd think you'd be pretty much there.


          • 2. Any way I can OOP this?
            robbyk87 Level 1
            Thanks! Quick question, so if I were to create a repeater with the button elements set up. And then get the index position of the repeater in the HTTP service.

            Can I do something like {myRepeater.selectedIndex.source}? to get the source of the button image?
            • 3. Re: Any way I can OOP this?
              Level 7

              "robbyk87" <webforumsuser@macromedia.com> wrote in message
              news:gnrv6j$782$1@forums.macromedia.com...
              > Thanks! Quick question, so if I were to create a repeater with the button
              > elements set up. And then get the index position of the in the HTTP
              > service.
              > Can I do something like {myRepeater.selectedIndex.source}? to get the
              > source of
              > the button image?

              No. The event should can a reference to whichever component generated the
              event. In addition, look at Q9
              http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf for more
              info on how to refer to repeater children.