3 Replies Latest reply on Sep 4, 2008 2:04 PM by Mike J. Potter

    Flex Builder Sample fails.

    aephillips
      I just downloaded Flex Builder 3 and attempted to run the sample application that was sent with Builder.

      The application looks like:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      backgroundGradientColors="[0xFFFFFF, 0xAAAAAA]"
      horizontalAlign="left"
      verticalGap="15"
      horizontalGap="15"
      creationComplete="service.send()">
      <mx:HTTPService id="service"
      url=" http://www.flickr.com/services/rest/?method=flickr.photos.searc&api_key=db502e017c65ff6f79 68953a5c59ac&per_page=30&tags={searchTerms.text}"/>
      <mx:HBox>
      <mx:Label text="Flickr tags or search terms:" />
      <mx:TextInput id="searchTerms" text="Blue" />
      <mx:Button label="Search" click="service.send()" />
      </mx:HBox>
      <mx:Tile>
      <mx:Repeater id="myrep" dataProvider="{service.lastResult.rsp.photos.photo}">
      <mx:Image source="{myrep.currentItem.thumbnail.url}"/>
      </mx:Repeater>
      </mx:Tile>
      </mx:Application>

      I get an error on the line that begins with "method=flickr.photos.searc"

      The error message states: (The reference to entity "api_key" must end with the ';' delimiter.)

      Is there some additional configuration that I have to do after installing Builder?

        • 1. Re: Flex Builder Sample fails.
          Gregory Lafrance Level 6
          You must replace & characters in the url with &#38; because in MXML tags the & is interpreted as the start of an XML entity.

          Also, "flickr.photos.searc" should be changed to "flickr.photos.search" (typo).

          Also, if you paste the fixed url in a browser address area, you get this error:

          Invalid API Key (Key not found)

          I don't know where you got this example, but it is hosed.
          • 2. Re: Flex Builder Sample fails.
            aephillips Level 1
            Greg,

            Thanks for your help.

            The "&#38;" seems to get me past that error alright.

            The example was sent in an email from Adobe after I downloaded the Flex Builder 3 Trial. I just copied and pasted it into Flex Builder exactly as they had sent it to me.

            The email message included this:

            Create your first rich Internet application
            Creating your first Flex rich Internet application is easy. Just copy the following code into a new Flex project inside Adobe Flex Builder. The application will search Flickr for photos related to a keyword that is entered into the search box. If you have problems, check out the Flex 3 Getting Started Guide Wiki page on creating a simple RIA.

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
            backgroundGradientColors="[0xFFFFFF, 0xAAAAAA]"
            horizontalAlign="left"
            verticalGap="15"
            horizontalGap="15"
            creationComplete="service.send()">
            <mx:HTTPService id="service"
            url=" http://www.flickr.com/services/rest/?method=flickr.photos.searc&api_key=db502e017c65ff6f79 68953a5c59ac&per_page=30&tags={searchTerms.text}"/>
            <mx:HBox>
            <mx:Label text="Flickr tags or search terms:" />
            <mx:TextInput id="searchTerms" text="Blue" />
            <mx:Button label="Search" click="service.send()" />
            </mx:HBox>
            <mx:Tile>
            <mx:Repeater id="myrep" dataProvider="{service.lastResult.rsp.photos.photo}">
            <mx:Image source="{myrep.currentItem.thumbnail.url}"/>
            </mx:Repeater>
            </mx:Tile>
            </mx:Application>
            • 3. Re: Flex Builder Sample fails.
              Mike J. Potter
              Hi there
              Can you please forward me a copy of the email message? You can send it to me at mpotter@adobe.com.

              Thanks,

              Mike