Well man, this is a hack and it works though :)

I had the same issue and so far this hasn't blown up in my face.

Try this on for size... the backgroundInstance is what is going behind the
content but infront of the border.

   override mx_internal function createContentPane():void
   {
       super.createContentPane();

       if (contentPane &&
           backgroundInstance)
       {
           var border:DisplayObject = rawChildren.getChildByName("border");
           var index:Number = (border) ? 0 : -1;

           rawChildren.setChildIndex(DisplayObject(backgroundInstance),
index + 1);
           rawChildren.setChildIndex(contentPane, index + 2);
       }
   }

Peace, Mike


On 10 Mar 2007 22:25:22 -0800, Jesse Warden <[EMAIL PROTECTED]>
wrote:

  I'm extending Canvas.  His base class, Container, decrees on line 4608
that all children are behind chrome.  I want the opposite.  I want my chrome
BEHIND the content; I want the content IN FRONT of my chrome.

However, since Container does all kinds of crazy over-writting of
DisplayObject methods and tucks them away in mx_internal and various other
private & final prefix's, I have no clue how to easily make my chrome inside
of rawChildren go backwards.  Obviously, setChildIndex doesn't work at this
point because the base class owns those methods as proxies now.

The hack, for now, is to NOT have my chrome draw a background.  If it
doesn't, I can click on children just fine.  That, however, sucks because I
want a background.  Figured 2nd hack is to just set the backgroundColor
property to my chrome's background, and redraw my chrome as a mask for the
background.  That is worse.

Suggestions?



--
Teoti Graphix
http://www.teotigraphix.com

Blog - Flex2Components
http://www.flex2components.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to