For that you can specify the your own required value in the native component
itself.. Because the native components has already exposed these properties.
simply you can set the value...

But for your reference am sharing one piece of code,

public class CustomTextInput extends TextInput
{
        //width property
        private var _width:int;

        //Constructor (if you needed)
        public function CustomTextInput ()
        {
            super();
        }

        public function get width():int
        {
            return _width;
        }

        public function set width(b:int):void
        {
            //your logic
            _width= b;
        }

        // Similarly for other properties like height, font size etc.
}

*Note:*

Properties are exposed by get() and set() methods.. By using those methods
you can assign the value using set() method and retrieve the value using
get() method.

*For example,*

*CustomTextInput.width = 50;*   // This will assign the CustomTextInput
width value using set() method

var widValue:int;
*widValue = CustomTextInput.width;*  // This will return the
CustomTextInput's width value.



On Thu, Apr 7, 2011 at 6:19 PM, Gerald Anto Fernando <
[email protected]> wrote:

> suppose if want change the defualt size of font and color of font and
> default width and height of textInput etc
> how to i do manikandan and naveen
>
> please add the code into what you wrote that is exactly i need to know
>
> Thanks&Regards,
> Gerald A
>
> On Thu, Apr 7, 2011 at 4:29 PM, Manikandan S 
> <[email protected]>wrote:
>
>> Hi Gerald,
>>
>> U want to create a component from Flex native component? If yes means
>> create a custom component extending from Flex native component and then add
>> your own methods and properties to the custom component.
>>
>> For example,
>>
>> public class CustomTextInput extends TextInput
>> {
>>         private var _sampleText:String;
>>
>>         //Constructor (if you needed)
>>         public function CustomTextInput ()
>>         {
>>             super();
>>         }
>>
>>         public function get sampleText():String
>>         {
>>             return _sampleText;
>>         }
>>
>>         public function set sampleText(b:String):void
>>         {
>>             //your logic
>>             _sampleText = b;
>>         }
>> }
>>
>> Likewise you can add methods and can override existing methods.....
>>
>>
>>
>>
>> --
>>
>> Regards,
>>
>> Manikandan.S  <http://www.umoldit.com>
>> <http://www.umoldit.com>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Flex India Community" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/flex_india?hl=en.
>>
>
>
>
> --
> Thanks & Regards,
> A  Gerald
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>



-- 

Regards,

Manikandan.S  <http://www.umoldit.com>
 <http://www.umoldit.com>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to