1 Reply Latest reply on Aug 24, 2011 11:51 PM by drkstr_1

    Includeinlayout for dynamically created label

    Muhshin.B

      Sample coding

       

      hbox=

       

      new HBox();

      img_1=

      new Image();

      img_2=

      new Image();

      lbl_lookup=

      new Label();

      img_1.load(

      '/IST_Shared/IST_images/IST_icons/Modern/gif/16/normal/trash_16.gif');

      img_2.load(

      '/IST_Business_Applications/IST_Shared/IST_images/IST_icons/Modern/gif/16/normal/edit_16.g if');

      img_2.addEventListener(

      "click",img_on_click);

      lbl_lookup.text=data.GET_SPSRS[i].spsrs_data;

      lbl_lookup.setStyle(

      "color",0x0000000);

      lbl_lookup.addEventListener(

      "click",img_on_click);

       

      Txt_look=new TextInput();

      Txt_look.visible=false;

      Txt_look.includeInLayout=false;

       

      hbox.addChild(img_1);

      hbox.addChild(img_2);

      hbox.addChild(lbl_lookup);

       

      hbox.addChild(Txt_look);

      hbox.addEventListener(MouseEvent.ROLL_OVER,hbox_on_roll);

      hbox.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE,focus_out);

      vbox.addChild(hbox);

       

       

      function focus_out(event):void
                  {
                   hbox_arr[3].visible=false;
                   hbox_arr[3].text=hbox_arr[3].text;
                   hbox_arr[2].visible=true;
                  }
                  function hbox_on_click(event):void
                  {
                   hbox_arr=new Array();
                   hbox_arr=event.currentTarget.getChildren();
                 
                  }
                  function img_on_click(event):void
                  {
                    hbox_arr[3].visible=true;
                    hbox_arr[3].setFocus();
                   hbox_arr[3].includeInLayout=true;(this include in layout is not working)
                   hbox_arr[3].text=hbox_arr[2].text;
                   hbox_arr[2].visible=false;
                   hbox_arr[2].includeInLayout=false; (this include in layout is not working)

       

                  
                  
                  }