Police style in Spark TextInput control

Hello!

How I can do as the title suggests it please?

I can do it without using a customized appearance because I want to be able to modify programmatically the fontColor and fontStyle.

Thank you!

You can do this very easily with spark textinput too. Pls check below and let me know if you have any problem.


http://ns.Adobe.com/MXML/2009.
xmlns:s = "library://ns.adobe.com/flex/spark".
xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >
   
       
   

   
        Import mx.collections.ArrayCollection;
           
[Bindable]
private var acFontSizes: ArrayCollection = new ArrayCollection([) collection
{fontSize: '12'},
{fontSize: '16'},
{fontSize: '20'},
{fontSize: '24'},
{fontSize: '28'},
{fontSize: '32'},
{fontSize: "36 '},
{fontSize: '40'},
{fontSize: '44'}
]);
]]>
   

   
           
           
               
               
           

           
               
               
           

   

with respect,

Mayeul singh Bartwal

Tags: Flex

Similar Questions

  • How to change the color of disabled text in spark TextInput?

    Hi guys,.

    Disabled by default for spark TextInput text color is too light. It is difficult to see. So I want to make it a little dark.

    The s:TextInput is placed inside the mx:Form or s:Group in fact, and I put the container for people with reduced mobility.

    I tried with TextInputSkin, but without success.

    Thanks in advance,

    Cheng Wei

    You can try to change the Group disabledAlpha style:

    http://ns.Adobe.com/MXML/2009.
    xmlns:s = "library://ns.adobe.com/flex/spark" >


       
       
           
       

       
       
           
       

        

  • Custom spark list control

    I have a spark list control that displays a dynamically imported Images tilelayout.  Basically, a bunch of thumbnail Images that appear in a tile layout.  I slipped active so that I can reorganize these thumbnails and everything works great except for one thing, the who.  In my itemrenderer I included Image in the State "dragging", but the image does not appear in the who.  I'm basically just has a square semi transparent like my, but I want to be able to actually drag my sticker.  Any ideas how to do this?

    Here is my list:

    < s:List id = "ImageList1" x = "77" y = "95" width = "858" height = "412" dataProvider = "{imageAC}".

    itemRenderer = "converters. ImageACSmallItemRenderer"contentBackgroundColor ="0x000000 ".

    borderVisible = 'false' dragEnabled = "true" dropEnabled = "true" dragMoveEnabled = "true".

    allowMultipleSelection = "true" skinClass = 'skins. General.ListSkin' focusAlpha = '0' mouseMove = "getImageProxy (event)" >

    < s:layout >

    < s:TileLayout columnWidth = rowHeight = "76" "76" horizontalAlign = "center" verticalAlign = "middle".

    horizontalGap = "8" verticalGap = "8" / >

    < / s:layout >

    < / s:List >

    Here's my Itemrenderer:

    < fx:Script >

         <! [CDATA]

    import mx.utils.ObjectProxy;

    [Bindable]

    public var dataProxy:ObjectProxy;

    private function init (): void {}

    dataProxy = new ObjectProxy (data);

              }

         ]]>

    < / fx:Script >

    < s: states >

    < s: State name = "normal" / >

    < s: State name = "flat" / >

    < s: State name = "selected" / >

    < s: State name = 'slide' / >

    < / s: states >

    < mx:Image source = "{dataProxy.pathSmall}" horizontalCenter = red "0" = "0" includeIn = "normal, hovered, selected, dragging" / > "

    < / s:ItemRenderer >

    Thanks for any idea!

    Hi Bill,

    Looks like you create a new object for each ItemRenderer ContentCache, to create a single instance shared, add "static" like this:

    static public var contentCache:ContentCache = new ContentCache();
    

    This will ensure that the contentCache variable is shared between all of the ItemRenderers.

    In addition, in my view, there is no need to explicitly call the contentCache like this:

    contentCache.load(dataProxy.pathSmall);
    

    Fixing the contentCache just the contentLoader on the Image property, the way you have done should be sufficient.

    I just do a quick experiment and here is an example with an ItemRenderer that exposes the problem:

    
    
        
    
    
    

    And here's workaround with contentCache (works well for me in the AIR):

    
    
                    
    
        
    

    See you soon,.

    Evtim

  • How to dynamically add data in a Spark list control

    Hi, I have a spark list in one of my custom components() control(id="Cclist") and a text input control. When a value is entered in the entry of the texts, I want to dynamically add the same in the list control. I tried to do the following:

    protected function Cc_selectHandler(event:CustomEvent):void

    {

     var cctext:DisplayObject = event.data as DisplayObject
    CcList.enabled = true;
    CcListButton.enabled = true;

    CcList.addChild(cctext);

    }

    But I get an error saying "addChild() is not available in this category.  "Instead, use addElement(), or change the skin. So I tried to use addElement, but apparently it is not available at all. No idea what im doing wrong?

    Add the text entered in the textinput to the dataProvider of the list in the appropriate format.

    A simple example:

    
    
        
            
        
    
        
            
        
    
        
            
        
        
        
        
    
    
  • Change the highlight color for text in Spark TextInput

    Hello

    As the title says, someone knows how to change the highlight color in a TextInput spark? By the "highlight color" I mean that some of the text is selected if the background color of the selected text.

    Thank you.

    SetStyle ("focusedTextSelectionColor",...)

    There are also unfocusedTextSelectionColor and inactiveTextSelectionColor

    styles.

  • Flex 4: spark textinput 'value data' not found?

    I have a textinput itemrenderer that Im trying to port for Flex 4. This control colors the background according to the value of the text.

    Two questions:

    (1) conversion for "spark" as a theme seems to be the substitution of the background color and given them to a default value.

    (2) in addition - conversion in "spark.controls.textinput" as the base class removes "override public set data() ' in function.

    If I'm not clear how this port control. Can I continue to use mx.controls. * and 'halo', but it seems that the device port at all.

    Suggestions?

    The spark controls do not have the itemrenderer feature in so that they can

    be a little less heavy.  I would give just a TextInput in an ItemRenderer.  See

    the doc and examples on Spark ItemRenderers.

  • Flex4 embed fonts for a spark textInput does not

    I can get the built-in fonts to work with mx:labels, but not for textInputs candles. any ideas? the component code:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/halo"
         width="275" height="107" xmlns:local="*"
         initialize="group1_initializeHandler(event)">
         <s:layout>
              <s:BasicLayout/>
         </s:layout>
         <fx:Style>
         @namespace components "components.*";
         @namespace mx "library://ns.adobe.com/flex/halo";
         @namespace p "*";
         @namespace s "library://ns.adobe.com/flex/spark";
              
         @font-face {
            src:url("../fonts/verdanab.ttf");
                 fontFamily: verdanaBold;
                 advancedAntiAliasing: true;
                 fontWeight: Bold;
                 unicodeRange:
                    U+0041-005A, /* Upper-Case [A..Z] */
                    U+0061-007A, /* Lower-Case a-z */
                    U+0030-0039, /* Numbers [0..9] */
                    U+002E-002E, /* Period [.] */
                    U+002D-002D, /*  [-] */
                    U+0040-0040; /*  [@] */
              }
              
              @font-face {
               src:url("../fonts/verdanab.ttf");
                 fontFamily: verdanaBoldSpark;
                 advancedAntiAliasing: true;
                 fontWeight: Bold;
                 cff: true;
                 unicodeRange:
                    U+0041-005A, /* Upper-Case [A..Z] */
                    U+0061-007A, /* Lower-Case a-z */
                    U+0030-0039, /* Numbers [0..9] */
                    U+002E-002E, /* Period [.] */
                    U+002D-002D, /*  [-] */
                    U+0040-0040; /*  [@] */
              }
              
              .myBold {
                 fontSize: 12;
                 fontFamily: verdanaBold;
                     fontWeight: bold;
              }
              
              .myBoldSpark {
                 fontSize: 12;
                 fontFamily: verdanaBoldSpark;
                     fontWeight: bold;
              }
         
         
         </fx:Style>
         <s:Group id="front">
              <local:MailingListFront/>
              <mx:Label x="10" y="34" text="first name" styleName="myBold"/>
              <s:TextInput id="fname" width="81" x="10" y="52" styleName="myBoldSpark" />
              <mx:Label x="95" y="34" text="last name" styleName="myBold"/>
              <s:TextInput  id="lname" width="81" x="95" y="52" styleName="myBoldSpark"/>
              <mx:Label x="10" y="77" text="email" styleName="myBold"/>
              <s:TextInput id="email" width="167" x="10" y="95" styleName="myBoldSpark"/>
              <mx:Label x="181" y="77" text="zip" styleName="myBold"/>
              <s:TextInput id="zip" width="48" x="181" y="95" styleName="myBoldSpark"/>
              <local:SubmitButton id="submit_maillist" x="235" y="86" />
         </s:Group>
         <local:MailingListBack id="back" visible="false"/>      
    
    </s:Group>
    

    According to which build, the name of the "cff" property changed to "embedAsCFF.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Incorporating the .ttf fonts in Spark TextInput 'invites '?

    That's what I have:

    Main.MXML:

    <fx:Style source="Main.css"/>
       
    <s:TextInput x="72" y="95" focusColor="#CECB02" prompt="E-mail: "
                
    skinClass="components.TextInputSkin"/>

    TextInputSkin.mxml:

     <s:RichText id="promptDisplay" includeIn="disabledWithPrompt,normalWithPrompt" x="10" y="7"
           
    color="#666666" fontFamily="Acens" fontSize="15" trackingRight="1"
           
    color.normalWithPrompt="#333333"/>
       
    <s:RichEditableText id="textDisplay" d:userLabel="Text Display" x="10" y="7" width="230"
           
    fontFamily="Acens" fontSize="15" heightInLines="1"
           
    width.normal="282" color.normal="#999999"
           
    tabStops.normal="S0 S50 S100 S150 S200" trackingRight.normal="1"/>

    Main.CSS

    @font-face
    {
        fontFamily
    : Acens;
        src
    : url("C:\WINDOWS\Fonts\Acens.ttf");
        embedAsCFF
    : true;
    }

    So, the 'promptDisplay' in a computer (online) that does not installed "Acens.ttf" shows that predefined, but the text of the inscription is shown correctly with the embeded font! Any explanation/solution for it!

    Thank you ;-)

    Is the prompt to set up to show the italic or bold?  If so, you need to incorporate italic or bold version as well.

  • Customization of Spark TextInput

    I am creating a custom converter of element TextInput:

    package
    {
    Import spark.components.Grid;
    Import spark.components.TextInput;
    Import spark.components.gridClasses.GridColumn;
    Import spark.components.gridClasses.IGridItemRenderer;

    public class gridTextInput extends TextInput implements IGridItemRenderer
    {
    public void gridTextInput()
    {
    Super();
    setStyle ("borderVisible", false);
    }

    ......

    When I run my code rendering still has a border. What is wrong with my code?

    Thank you

    Works for me. Do you mean the grid lines? or the actual border of the TextInput? What happens if you set to true borderVisible?

    A solution would be to reskin the TextInput and remove the border.

    -Kevin

  • With the help of the police included in the tree control

    Hello

    I am trying to use embedded font to change the font family for a control tree but hopeless, I tested the police embedded with a label component and it worked well, but for the tree control, I couldn't succeed.

    Can anyone help with this, don't--what someone has any idea?

    You must embed the version "BOLD" to the police as well.

  • Sparks tree control: ETA?

    This question is for the SDK team:

    Is there an ETA for a spark-based tree control? The project that I'm trying is heavily based on the tree control. In the last 6 months I've tweaked and customize the control tree 60 ways to Sunday. It has exposed a number of problems and bugs in the control, and by all accounts, it seems that Adobe will not address these in the future.

    Every day I fight these issues with the tree. Simple stuff can be very difficult.

    I propose that the project be migrated to Flex 4, for many reasons. However, the question has been raised by the stakeholders, who are aware of the issues that we have struggled on the current control, is when the Spark version will be released. I don't have an answer.

    Thank you

    TJ Downes

    It won't in 4.5, probably the release after.

  • Spark TextInput text highlight color (or the manufacturing of spark and mx components alike)

    I use a mixture of spark and mx components. Really, I use only the spark, but I need dateField components too, and these are just the spark. The question that I have is to have a common look between components and this isn't quite the case when it comes to highlight the text in a textInput (DateField, NumericStepper or or ComboBox, etc.). Default components to blacks and nail fonts sparks bluish. Default MX black on white to white on black to selected and unselected.

    I looked around for hours and sort of up to mx look like spark, even if I like the spark look much better (although that would like to hear if something new has come with flex 4 for this). I assumed that at least making resemble spark mx would be easy. But is it?

    I know how to change the color for the highlight (i.e. the substantive part) using focusedTextSelectionColor. What I can't find is the same for fonts, i.e. something like focusedSelectedFontColor. But I don't know that there is. It must, right?

    Anyway, would love the pointers that you can save.

    Thank you!

    f

    You can use FTEText in MX components.  You can use the mock datefield

    my blog

    --

    Alex Harui

    Flex SDK Team

    Adobe System, Inc..

    http://blogs.Adobe.com/aharui

  • problems with the textinput control

    Hi all

    I am currently creating an Air based web browser, but I encountered a small problem that I can't find transient. When you enter the web address in the address normally bar i.e. http://www.adobe.com, it works fine. However, if enter you under adobe.com without the http standard he goes to app: / adobe.com. Is anyway to change this? Any help is appreciated. I've included a snippet of my code in order to get a better image.

       //this is the main code that deals with the textinput//
    
                            <mx:TextInput id="txtURL" text="http://www.google.com" 
                   editable="true" enabled="true"
                   change="changeInput(event);"
                   textInput="urlTextInput(event)"
                   enter="urlEnter(event)"/>
    
    //other code here.//
    
                             private function urlTextInput(event:TextEvent):void {
                        // trace("urlTextInput event:"+event.text);
                        if (!this.bUserEditingLocation)
                        {
                          trace("Setting bUserEditingLocation = true");
                          this.bUserEditingLocation =true;
                        }
                   }
    
                   private function urlEnter(event:Event):void {
                        trace("urlEnter");
                        if (webbrowser.location != txtURL.text)
                        {
                        trace("bUserEditingLocation = false and setting location to "+txtURL.text);
                        webbrowser.htmlLoader.cancelLoad();
                        webbrowser.location =      txtURL.text;
                        bUserEditingLocation = false;
                        focusManager.setFocus(webbrowser);
                        }
                   }
    
                   private function changeInput(event:Event):void {
                   }
    
                   private function SetURLTextInput(S:String):void
                   {
                        trace("SetURLTextInput to "+S);
                        txtURL.text = S;
                   }
    
                   private function browserComplete(event:Event):void {
                        if (txtURL.text != webbrowser.location)
                        {
                             if (!IsUserEditingLocation())
                        {
                             trace("BrowserComplete setting new location to text input "+ webbrowser.location);
                             SetURLTextInput(webbrowser.location);
    
                        }
                        else
                        {
                            trace("BrowserComplete while user is editing");
                        }
                   }
                        else
                        {
                             trace("BrowserComplete to same location");
                        }
    
                       // Stop the marching dots, and return to the default text and color.
                       bLocationChanging = false;
                        lblURL.setStyle("color",DefaultButtonColor);
                        lblURL.text = DefaultButtonText;
                   }
    

    This can be even better:

    If (textURL.text.length > = 2 & textURL.text.search ("ht")! = 0 & textURL.text.search (ww")})
    textURL.text = "http://www." + textURL.text;

    }

    If this post answers your question or assistance, please mark it as such.

  • style of the DataGrid control. All the same blue lines - odd rows white

    Hello.

    I saw a lot of tables where the second row is white and one is blue. This makes it easy read the data from a result including students.

    How - would you have to code in ie: coloring the lines even focusing on numbers or is it built in a way.

    See you soon

    Information:

    http://blogs.Adobe.com/pdehaan/2007/06/setting_a_flash_data_grids_bac_1.html

    http://blogs.Adobe.com/pdehaan/2007/06/alternating_background_colors.html

    Source files:

    http://blogs.Adobe.com/pdehaan/code/section13.example1.zip

    http://blogs.Adobe.com/pdehaan/code/Section12.example1.zip

  • TextInput style, change at design time.

    I'm new to Flash and working on the development of an iOS app.

    I have my first app of base running.

    My question is, how do I change the style of my TextInput at design time?

    I see how to do it in the code, but I hope I won't have to have a lot of extra code, justto set the styles of the entries.

    Thanks in advance,

    Clint

    One way you can probably do is to doubleclick the component on the stage and manually change the parts that compose it by doubleclicking and their modification.

    If you use a component TextInput and you have problems with the fact that code for this style, you might consider switching to just by using a Textfield.  Components tend to be somewhat heavy creatures, partly because of the various graphics they carry but mostly because of the code that they carry.  To see how the TextInput contributes to the weight of a file, start a new file and place a TextInput onstage.  Then, with the Flash option publish Settngs to generate the report of chosen size, publish the file and see the bytes contributed in the output panel.

Maybe you are looking for