4 Replies Latest reply on Nov 28, 2010 5:58 AM by flex2008

    Border container

    athiroy

      hi

      i have one bordercontainer named mainlayout.

      It contains another two border containers name ch1,ch2.

      Both are contains images.

      Now i want when i press the button at the time mainlayout childs ch1and ch2 are paste into another border container like copy and paste method

      is it possible.

      pls suggest me

      regards

      athi

        • 1. Re: Border container
          flex2008 Level 3

          You can acheive this by removing ch1 and ch2 from mainlayout using mainlayout.removeElement methos and adding ch1 and ch2 to the second container by using the addElement method.

          • 2. Re: Border container
            athiroy Level 1

            hi

             

            but i want to display the copy of the first container into another bordercontainer

            regards

            athi

            • 3. Re: Border container
              flex2008 Level 3

              This is the one logic that comes to my mind.I am not sure if there are any cons for this or if this is possible or not.Just give it a try.

               

              Create copies of the instances of ch1 and ch2 using ObjectUtil.copy() and add the copies to the second bordercontainer.

              • 4. Re: Border container
                flex2008 Level 3

                Another way to do this:Define drag and drop between the two bordercontainers so that you can copy (not move)the contents from one to another.Then, in the button click try to fake the drag and drop.That means,you have to manually set the respective events and dispatch them.Give it a try and let me know if it works.In the meanwhile,if possible i will try to come up with a eg. illustrating this.