15 Replies Latest reply on Aug 1, 2008 11:44 AM by Newsgroup_User

    Setting Background Colour with a Value Retrieved from a Database

    katychapman85 Level 1
      I'm retrieving different colours from a database and I want to set the background colour of a canvas to the colour retrieved. I've tried doing the following:

      <mx:TileList
      x="2" y="237"
      direction="horizontal"
      dataProvider="{MakeUpColours.lastResult.Colour}"
      backgroundColor="#FFFFFF"
      width="288" height="167.04999"
      themeColor="#FFFFFF">

      <mx:itemRenderer>
      <mx:Component>
      <mx:Canvas width="35" height="35">
      <mx:Canvas width="30" height="30" x="5" y="5" backgroundColor="{data.ColourNo}">
      <mx:Image source=" http://localhost/Flex/Personalised%20Palettes-debug/{data.@PictureSrc}"/>
      <mx:Label text="{data.@ColourNo}"/>
      </mx:Canvas>
      </mx:Canvas>
      </mx:Component>
      </mx:itemRenderer>
      </mx:TileList>

      But it just makes the background colour black. Any suggestions?

      Thanks
      Katy