5 Replies Latest reply on May 25, 2009 11:16 PM by FlexHelpNeeded

    Flex Image Gallery Help needed

    FlexHelpNeeded Level 1

      Hey Guys..

       

      So I am totally new to Flex / PHP / SQL. I am doing this for a small task. Basically there is a SQL server containing details of images and location information. Using Flex 3 we need to get details from the server and post them like a image gallery. We can use anything like datagrid , HBox etc..

       

      Now I have a query written which spits data back in XML format for all the images.

       

      The format of the coming back XML is something like

       

       

      <images>
      <location>.....</location>
      <name>Nameof Pic </name>
      <caption>captionofpic</caption>
      </images>
      

       

       

      Now my question is

       

      1) How do I populate these images in a datagrid or hbox etc.. I have no clue how to get this data and put them into use.. tried a lot of search but everything is so complicated. Looking for the simplest solution. does not matter how it looks..

       

      More questions are after i fix this

       

      thanks a lot

        • 2. Re: Flex Image Gallery Help needed
          FlexHelpNeeded Level 1

          Michael Borbor wrote:

           

          ARe you looking for something like this?

           

          http://www.adobe.com/devnet/flex/samples/photo_explorer/

          yeah something exactly like that.. but they are looking so complex in coding.. I need to do a very basic one.. can u please guide if possible

           

          There it is a XML file stored.. I have a XML file generated via PHP from SQL server.. I don't know how to apply this data coming back to make something like whats shown above

           

          thanks

          • 3. Re: Flex Image Gallery Help needed
            Michael Borbor Level 4

            I could help you but I'm gonna call it a night, folks at europe and asia should be on-line soon so they could help you, if they don't tomorrow I'll give you a hand. Meanwhile you can find great starting tutorials here

             

            http://learn.adobe.com/wiki/display/Flex/1d.+RIA+Tutorial.

             

            Good night.

            1 person found this helpful
            • 4. Re: Flex Image Gallery Help needed
              FlexHelpNeeded Level 1

              Michael Borbor wrote:

               

              I could help you but I'm gonna call it a night, folks at europe and asia should be on-line soon so they could help you, if they don't tomorrow I'll give you a hand. Meanwhile you can find great starting tutorials here

               

              http://learn.adobe.com/wiki/display/Flex/1d.+RIA+Tutorial.

               

              Good night.

              Thanks Michael

               

              It helped and I have made some scratch code from it. Now what I have done is

               

              create a button to call photos

               

              <mx:Button x="242" y="57" label="Load Photos" id="getphotos" click="browsephotos.send();"/>
              

              Then created a HTTPservice when the button is clicked

               

                <mx:HTTPService id="browsephotos" url="XXXXXX" method="POST" result="getphoto(event)">
                     <mx:request>
                         passing some stuff here
                     </mx:request>
                 </mx:HTTPService>
              

               

              The XML generated from this request is in the format

               

              <photos>
              <photoloc></photoloc>
              <caption></caption>
              </photos>
              

               

              Now to capture this data I have made a function called getphoto

               

                  private function getphoto(event:ResultEvent):void
                          {
                              feed = event.result.photos as ArrayCollection;
                              
                          }
              

              feed is delacred previously as an array collection bindable

               

              Now my current question is

               

              1) Is it the right way to capture the XML data coming in ? I mean is the event.result.photos right???

               

              Also Now to display it I have done

              <mx:itemRenderer>
               <mx:Component>
                 <mx:VBox width="125" height="125" horizontalAlign="center">
                 <mx:Image width="75" height="75" source="????????" /> // should be from photoloc
                 <mx:Text text="????????" /> //should be from caption
                 </mx:VBox>
                </mx:Component>
               </mx:itemRenderer>
              

               

              Now How do i fill in the two sources mentioned there?? I don't know what the correct format is going to be??

               

              Thanks for all the help guys!!!

              • 5. Re: Flex Image Gallery Help needed
                FlexHelpNeeded Level 1

                Fixed it myself.. thanks guys!!!