If you don't extend UIObject, then what is your sizing implementation. UIObject handles that for you. Furthermore, you can compile mx components with MTASC if you don't want to have to write that stuff by yourself, or use another open source component set.
UIComponent actually has it's own seperate variables for width and height values which allows you're component to use them vs. actually relaying on _width and _height to be preset. Typically, you use a bounding box movieclip on frame 1 to set the initial width and height and UIObject will remove it for you. If you don't want to do that you can do what UIObject in Flex does, and implement a measure function; this function by default sets the width and height and is used initially to setup the default width and height if none has been set beforehand. If you aren't using UIObject / UIComponent, you'll have to code all of that yourself unless another component framework provides that for you. ----- Original Message ----- From: "Julian 'Julik' Tarkhanov" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com> Sent: Sunday, April 23, 2006 12:17 PM Subject: [Flashcoders] Components do not behave Ok, so I got the component thing running more or less. I now have a dozen of components (all using the same assets - such as bevels etc.). I only got a couple of problems to iron out. My components, though, do not inherit from UIObject (or other MM classes) - I try to avoid that to allow compilation with MTASC in th future without attachment to Flash IDE. First of all is the whole resizing business. I have to both resize the component in the init code and in the setSize - I still don't understand the relationship between the two. Right now how I have to do it: function initComponent():Void { // bla bla // rearrange components based on the new _width and _height } function setSize(nWidth:Number, nHeight:Number):Void { // bla bla // rearrange components based on the new _width and _height AGAIN } This is te only approach that works. The second problem is exporting SWC. Some SWCs work after export, some others don't. One, for instance, shows nothing on the Stage when included in another file, but works beautifully - the other shows up OK on the Stage but looks like in the authoring environment upon exporting. When I drag the symbols from my main document (where all the widgets get created) the work and show up fine. I wonder if there is some good documentation about creating SWCs somewhere, or if csomeone can explain to me what am I doing wrong. -- Julian 'Julik' Tarkhanov please send all personal mail to me at julik.nl _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com