Here is a very simple MXML component that extends TextArea

<?xml version="1.0" encoding="utf-8"?>
<mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml"; 
borderThickness="0" backgroundAlpha="0" focusThickness="0" 
width="100%" height="100%" selectable="false"/>

Save that file. Then to use the component simply type 
<TextRegion in your application document.

<> component:TextRegion should be the only thing left in the autofill 
list... Press Enter.

If you select this Flex Builder should automatically:
1. Add the necessary namespace to the document root node
 xmlns:component="mxml.component.*"
2. Change your text from "<TextRegion" to "<component:TextRegion"

When you embed this in your document you can also override the 
properties you set in your component with your own values as I have 
done with height here...

<component:TextRegion htmlText="Lorem Ipsum..." 
maxWidth="{staticWidth}" height="50" borderThickness="0"/>

You can also create an AS3 component but remember that every mxml 
file in Flex can be considered a component. To extend the component 
you simply override the properties in mxml and for most things there 
is no need to bother with AS3 classes.

If you decide you need AS3 components, there is some really good 
information from Ely Greenfield:
http://www.quietlyscheming.com/blog/components/flexbook/

Hope this helps...


Reply via email to