Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

Setting the focus blend mode on a TextArea control in Flex – focusBlendMode

Posted on February 22, 2010 | No Comments

A class that provides constant values for visual blend mode effects. These constants are used in the following:
The blendMode property of the flash.display.DisplayObject class.
The blendMode parameter of the draw() method of the flash.display.BitmapData class
Example shows how you can set the focus blend mode of the focus rectangle on a Flex TextArea control by setting the focusBlendMode style.

Full code after the jump.

<?xml   version="1.0"   encoding="utf-8"?>
<mx:Application   name="TextArea_focusBlendMode_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle">

      <mx:ApplicationControlBar dock="true"   styleName="plain">
        <mx:Form styleName="plain">
            <mx:FormItem label="focusThickness:">
                <mx:HSlider id="slider"
                        minimum="0"
                        maximum="24"
                        value="10"
                        snapInterval="1"
                        tickInterval="1"
                        change="textArea.setFocus();"   />
            </mx:FormItem>
            <mx:FormItem label="focusBlendMode:">
                      <mx:ComboBox id="comboBox"
                            selectedIndex="10"
                          change="textArea.setFocus();">
                      <mx:dataProvider>
                          <mx:Array>
                            <mx:String>{BlendMode.ADD}</mx:String>
                            <mx:String>{BlendMode.ALPHA}</mx:String>
                            <mx:String>{BlendMode.DARKEN}</mx:String>
                              <mx:String>{BlendMode.DIFFERENCE}</mx:String>
                                <mx:String>{BlendMode.ERASE}</mx:String>
                                    <mx:String>{BlendMode.HARDLIGHT}</mx:String>
                            <mx:String>{BlendMode.INVERT}</mx:String>
                                <mx:String>{BlendMode.LAYER}</mx:String>
                              <mx:String>{BlendMode.LIGHTEN}</mx:String>
                            <mx:String>{BlendMode.MULTIPLY}</mx:String>
                              <mx:String>{BlendMode.NORMAL}</mx:String>
                            <mx:String>{BlendMode.OVERLAY}</mx:String>
                              <mx:String>{BlendMode.SCREEN}</mx:String>
                              <!--
                            <mx:String>{BlendMode.SHADER}</mx:String>
                                  -->
                            <mx:String>{BlendMode.SUBTRACT}</mx:String>
                        </mx:Array>
                    </mx:dataProvider>
                    </mx:ComboBox>
            </mx:FormItem>
        </mx:Form>
      </mx:ApplicationControlBar>

    <mx:TextArea id="textArea"
            text="The quick brown fox jumps   over the lazy dog."
              focusThickness="{slider.value}"
            focusBlendMode="{comboBox.selectedItem}"       />

</mx:Application>

You can also set the focusBlendMode style in an external generic online cialis .CSS file or


Author
Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.

Comments

Leave a Reply

You must be logged in to post a comment.