0 Replies Latest reply on Feb 1, 2010 6:24 AM by venkateshk

    Highlighting based on combo value

    venkateshk

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="silver">
          <mx:VBox x="5" y="5" verticalGap="0" id="vb">
              <mx:HBox horizontalGap="0">
                  <mx:Canvas id="a" borderStyle="solid" width="300" height="300" borderThickness="2" borderColor="black"/>
                  <mx:VBox width="15" backgroundColor="yellow" height="300"/>
                  <mx:Canvas id="b" borderStyle="solid" borderThickness="2" width="600" height="300" borderColor="black"/>
                  <mx:VBox width="15" backgroundColor="yellow" height="300"/>
                  <mx:Canvas id="c" borderStyle="solid" borderThickness="2" width="300" height="300" borderColor="black"/>
              </mx:HBox>
              <mx:HBox height="15" width="{vb.width}" backgroundColor="yellow"/>
              <mx:HBox horizontalGap="0">
                  <mx:Canvas id="d" borderStyle="solid" width="300" height="300" borderThickness="2" borderColor="black"/>
                  <mx:VBox width="15" backgroundColor="yellow" height="300"/>
                  <mx:Canvas id="e" borderStyle="solid" borderThickness="2" width="600" height="300" borderColor="black"/>
                  <mx:VBox width="15" backgroundColor="yellow" height="300"/>
                  <mx:Canvas id="f" borderStyle="solid" borderThickness="2" width="300" height="300" borderColor="black"/>
              </mx:HBox>
          </mx:VBox>
          <mx:ComboBox id="combo" dataProvider="{['A','B','C','D','E','F']}" x="300" y="{Application.application.height-50}"/>
          <mx:TextInput id="ti" width="60" x="360" y="{Application.application.height-50}"/>
          <mx:Button id="btn" x="440" y="{Application.application.height-50}" label="Click"/>
          <mx:WipeDown id="wipeDown" duration="3000"/>
          <mx:TitleWindow x="{Application.application.width-330}" title="Yard Details"  y="390" width="300" borderColor="red" borderThickness="3"
              creationCompleteEffect="{wipeDown}">
              <mx:HBox horizontalAlign="center" width="100%">
                  <mx:VBox horizontalAlign="center">
                      <mx:Label text="Name" fontSize="12" fontWeight="bold"/>
                      <mx:Label text="A" fontSize="12"/>
                      <mx:Label text="B" fontSize="12"/>
                      <mx:Label text="C" fontSize="12"/>
                      <mx:Label text="D" fontSize="12"/>
                      <mx:Label text="E" fontSize="12"/>
                      <mx:Label text="F" fontSize="12"/>
                  </mx:VBox>
                  <mx:VBox horizontalAlign="center">
                      <mx:Label text="Occupied (%)" fontSize="12" fontWeight="bold"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                  </mx:VBox>
                  <mx:VBox horizontalAlign="center">
                      <mx:Label text="Empty (%)" fontSize="12" fontWeight="bold"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                      <mx:Label text="{}" fontSize="12"/>
                  </mx:VBox>
              </mx:HBox>
          </mx:TitleWindow>
      </mx:Application>

       

      I am considering that one canvas is of 100 units for its width  total and another is of 200 units etc

      A,B,C,D,E,F of combo values represents different canvas

      and I can fix something as a unit value eg: for A it is of 10

      if i select A and I enter 1 in ti and click on button then I want to fill the 10% area of the total area of 'A' canvas with some color

      In this way I want to develop for all canvases dynamically based on the unit value

      Please help............ me