1 Reply Latest reply on Apr 24, 2007 2:56 PM by Archades

    Good way to make something appear on top of something?

    Archades
      I dont know the best way to approach this problem so I want to poke around for some ideas. I have a page with many TitleWindows on it and I need to have the one in focus appear on top of the other ones. Does anyone have a good method to do something like this?

      Thanks
        • 1. Re: Good way to make something appear on top of something?
          Archades Level 1
          I figured it out...It only takes 3 lines of code too so I figured I would share
          Given:
          <canvas id="parent">
          <TitleWindow id="tw1" />
          <TitleWindow id="tw2" />
          <TitleWindow id="tw3" />
          </canvas>
          You can just call this function to set the paremeter on top of the other title windows:
          private function setWindowOnTop(tw:TitleWindow):void
          {
          for(var i:Number=parent.getChildIndex(tw)+1; i<parent.numChildren; i++)
          {
          parent.swapChildren(tw, parent.getChildAt(i));
          }
          }