On 11/14/05, Teoti Graphix <[EMAIL PROTECTED]> wrote: > I have been experimenting with Flex2 custom component development. I > understand that the documentation on the alogortithms is not ready yet but, > would anyone want to enlighten me abit on the procedure for say creating a > custom component for the HBox and giving it a background(border).
I'm assuming you're creating a new component that has nothing to do with HBox, because HBox already has the border functionality built in. Or I'm assuming you're extending HBox but adding a new skin (not border). Either way... > (I don't mean how to create a component. How do I create a mc/progmatic > skin border IN my custom component using Flex2) > > I have tried so many differnt ways, subclassing SkinSprite, ProgmaticSkin, > RectBorder, HaloRectBorder and others ;-). The top-level class to use for creating programmatic skins is -- you guessed it -- ProgrammaticSkin. It implements the IFlexDisplayObject interface. Skins are not "content children" of a Container, so the way to add these objects is to add them through the allChildrenList API. var skin:MySkin = new MySkin(); this.allChildrenList.addChild(skin); In your updateDisplayList implementation, you have to just position and size the skin object using the move and setActualSize methods. setActualSize should try to respect the skin object's measuredWidth and measuredHeight if it makes sense. The skin actually draws itself in its own updateDisplayList method, which is called automagically by the layout manager. > Basically I understand the interface I need to implement, IUIComponent BUT, > I don't want to actually add the border as a "child" of the HBox layout, > just as a component asset... So when say using addChild() I get the nice, > can't coeirce border to IUIComponent. This is happening because you're using addChild() instead of allChildrenList.addChild() > Please, no idiot here just really want to get this one thing. I have > experimented with as3 and graphics object ect. I am just wondering about the > "correct way" if I am subclassing a component in the flex framework. Let me know if you have any quesitons. Hope this helps! Manish ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

