This content has been marked as final. Show 3 replies
before the rush of responses which is sure to arrive at some stage ;-) , i thought i should let you know that this ain't as urgent any more as i've just gone with the fudge - option 2)
Unfortunately, FormItem's label is just that, a Label. And Labels are not multi-line. But FormItem's actually use FormItemLabel, not Label directly. So you can write your own FormItemLabel and extend it from Text, not Label.
1. create the package mx.controls in YOUR application path.
2. create FormItemLabel.as in that package. Extend Text.
3. Override the protected function measure(), call super.measure(), then adjust measuredWidth and measuredHeight.
You'll have to experiment in the measure() function to get those values correct. The alternative is to explictly size the FormItem which is probably your best bet for accuracy.
By placing mx.controls.FormItemLabel in your application path, the Flash Player will load your FormitemLabel first and ignore the one in the frameworks.swc.
Disclaimer: I haven't tried this myself (it should work, though). And if you break Flex, well, you'll have to go with plan B.
very interesting advice peter. i hadn't considered(or even knew how) to modify the standard controls rather than needing to create new ones.
i had already gone with another solution by this stage but i know that this advice will come in very handy in the future. thanks for that.