4 Replies Latest reply on Jan 26, 2011 10:12 AM by jmessary

    Hero SDK - image source issue

    jmessary

      This is my first post to the site, however, I have found a lot of solutions to problems browsing these forums.

       

      My problem is as follows:

       

      I am trying to create a list using an itemRenderer and it generated everything nicely and most of the functionality works fine.  The problem is the image.  Everything else is working (ie. Product Name, Amount, etc) using the {data.XMLList node name}

       

      <s:Panel width="200" height="250" borderVisible="false" chromeColor="#2D455D" color="#FFFFFF" cornerRadius="10" fontSize="16" title="data.product_name}">

       

              <s:Image y="5" width="75" height="75" horizontalCenter="0" source="{data.image_source}"   />
              <s:Label x="6" y="88" color="#000000" fontSize="10" text="Retail Price:"/>
              <s:Label x="10" y="106" color="#000000" fontSize="14" text="Our Price"/>
              <s:Label id="retail_price" x="70" y="88" color="#000000" fontSize="10" text="${data.retail_price}"/>
              <s:Label id="our_price" x="70" y="106" color="#000000" fontSize="14" text="${data.our_price}"/>
              <s:TextInput x="12" y="145" height="62" color="#000000" text="{data.image_source}"/>

       

      </s:Panel>

       

      The image works fine if I put in a direct link (ie. http://www.somedomain.com/someimage.jpg).  I did an Alert.show to make sure I was getting the correct link out of data.image_source and indeed I am.  I can copy the alert message and paste in a browser and the image comes up immediately.

       

      So after I couldn't get this working I then decided to take a step back and just do a simple example.  Basically just tried to set an image source using an xml result.  I have done this in Flash Builder 4 and Flex 3 with no problems whatsoever.

       

      However, in Flash Builder Burrito using the Hero SDK I cannot seem to set the source of an image using a value from xml at all.  I am baffeled by this and have tried everything I can think of to debug this with no results.

       

       

      protected function get_panel_products_service_resultHandler(event:ResultEvent):void

      {
              panels_xml = new XMLList(event.result.product);

             //Image 1 -- Direct Link
             Alert.show("BEFORE: "+my_img.source); //RETURNS BEFORE: null
             my_img.source = "http://blog.internetnews.com/skerner/smk/testpilot.png";
             Alert.show("AFTER: "+my_img.source);  //RETURNS AFTER: http://blog.internetnews.com/skerner/smk/testpilot.png ||| IMAGE DISPLAYED
                     
             //Image 2 -- XML Result
             Alert.show("BEFORE: "+my_img2.source); //RETURNS BEFORE: null
             Alert.show("XML Image Source: "+panels_xml.image_source); //RETURNS XML Image Source: http://blog.internetnews.com/skerner/smk/testpilot.png
             my_img2.source = panels_xml.image_source;
             Alert.show("AFTER: "+my_img2.source); //RETURNS AFTER: http://blog.internetnews.com/skerner/smk/testpilot.png  ||| IMAGE NOT DISPLAYED
      }

       

      So basically even though the source prints out the same for each method of doing the assignment, only my_img is displayed.  my_img2 never displays at any point.

       

      Any ideas???