3 Replies Latest reply on Feb 16, 2010 12:08 AM by Shizorable

    Problems with giving a parameter in a canvas

    Shizorable

      So I made a main app that contains a canvas to enter an address.

      The problem is that there is a combobox in the canvas but I want to choose whether it's visible or not with a parameter.

       

      I got the following code :

       

      main app :

      ...
      <custom:AdresComponent  y="148" x="34" id="adres" cornerRadius="20" borderStyle="solid"/>
      ...
      

       

      The problem occurs when I add showState="true". All I get is a blank screen when it runs.

       

      The control :

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="486" height="120" backgroundColor="#FFFFFF">
           ...(labels, inputfields)
           <mx:ComboBox x="85" y="68" width="183" id="comboBoxState" visible="true">
                <mx:dataProvider>
                     <mx:String>...
                </mx:dataProvider>
           </mx:ComboBox>
           
           <mx:Script>
                <![CDATA[
                
                     private var _showState:Boolean = true;
                     
                     public function set showState(bln:Boolean):void {
                          _showState = bln;
                          if(bln) {
                               this.comboBoxState.visible = true;
                               this.labelState.visible = true;
                          }
                          else {
                               this.comboBoxState.visible = false;
                               this.labelState.visible = false;
                          }
                     }
                     
                     public function get showState():Boolean {
                          return _showState;
                     }
                ]]>
           </mx:Script>
           
      </mx:Canvas>
      
       
      

       

      Is there someone who knows how to solve this problem ?