Rich Rodecker’s blog on flash, flex, actionscript, javascript, and php, with a dash of randomness
random notes about components
getting into component dev in flash, so I just wanted to jot some notes down:
1. mx.core.View is better to extend from if your component has children it needs to lay out.
2. When you are extending from mx.core.View, calls to myComponent.size() are handled by the doLayout() method resize the border_mc (which is the RectBorder for the component that is set up in View) and then call the doLayout() method, which you overrisde in your class. Also, you don’t need the init() method, though (i think) you can still use it.
3. The Flash Help documentation, though it seems to be pretty well improved over mx04, still needs some work.
more to come, im sure.
about 4 years ago
#2: Need it? Nope. There if you want it? Hell yeah.
More mx.core.View 411:
mx.core.View Love
Using a TextField in mx.core.View
about 4 years ago
yeah, i’ve actually referenced those links a few times already. you mean the init method is there if i need it, right?
about 4 years ago
Yeah buddy. Sometimes there is stuff you need inited before createChildren is run, or pre-set to a specific value… or a getter/setter needs to run… whatever. Just ensure you call super.init, and you good to go like the funky coma-deena!
about 3 years ago
Do you have to initialize border_mc somehow in order for it to show up? My component extends mx.core.View and I sort of expected it would just render with a border around it.
Thanks,
Matt.
about 3 years ago
well i think the rectangular border is used for tab focus, when you tab to the component. im not sure about any initializing of it.