Setting BackgroundColor of a TextInput

Hello,
I've already tried a lot, but there was no way I could change
the color of my textInput. What am I doing wrong? Adobe Livedocs
couldn't help me and there was no working piece of code I could
find in other messageboards.
These things haven't work for me:
myTextInput.setStyle("backgroundColor", 0xFFF00);
myTextInput.setstyle("backgroundColor", Number(0xFFF00));
myTextInput.setstyle("backgroundColor", "#FFF00");
Do I have to do something about the border of the textInput.
Or about the "background"-Property (if it still exists for AS3)??

I mean, if you have enabled your textfield background
myTextInput.textField.background = true;
and you set some color to backgorund
myTextInput.textField.backgroundColor = 0xFFF000;
is this possible to make this backgroundColor to alpha channel.
So text is set to alpha 100% and textfieldBackground is set to alpha 50%
I know that you can make text to alpha, but textBackground i couldn't make to alpha... :/
myTextInput.textField.alpha = 0.3;

Similar Messages

  • Set cursor in a textinput

    In this example, the focus is set to the phoneInput object
    but the cursor in this textinput is not set. How can I do this?
    Thank you!
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    viewSourceURL="src/FormatterSimple/index.html"
    width="310" height="210"
    initialize="focusManager.setFocus(phoneInput);"
    >
    <mx:PhoneFormatter id="phoneDisplay"
    formatString="(###) ###-####"
    />
    <!-- User interface -->
    <mx:Panel
    title="Using a formatter in an item renderer"
    paddingLeft="10" paddingRight="10" paddingBottom="10"
    paddingTop="10"
    >
    <mx:Text text="Enter a phone number,
    including{&apos;\r&apos;}the area
    code{&apos;\r&apos;}e.g., 2025558721:"/>
    <mx:TextInput id="phoneInput" width="100%"/>
    <!-- Display the formatted phone number -->
    <mx:Text text="{&apos;Formatted:
    &apos;+phoneDisplay.format(phoneInput.text)}"/>
    </mx:Panel>
    </mx:Application>

    I tried this and it doesn't work!
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    viewSourceURL="src/FormatterSimple/index.html"
    width="310" height="210"
    creationComplete="focusManager.setFocus(phoneInput);"
    >
    <mx:PhoneFormatter id="phoneDisplay"
    formatString="(###) ###-####"
    />
    <!-- User interface -->
    <mx:Panel
    title="Using a formatter in an item renderer"
    paddingLeft="10" paddingRight="10" paddingBottom="10"
    paddingTop="10"
    >
    <mx:Text text="Enter a phone number,
    including{&apos;\r&apos;}the area
    code{&apos;\r&apos;}e.g., 2025558721:"/>
    <mx:TextInput id="phoneInput" width="100%"/>
    <!-- Display the formatted phone number -->
    <mx:Text text="{&apos;Formatted:
    &apos;+phoneDisplay.format(phoneInput.text)}"/>
    </mx:Panel>
    </mx:Application>

  • Setting backgroundColor to transparent

    Hi All,
    I'm using the tree component, and wondered if there was a way
    to set the backgroundColor style to "none".
    I saw one user used this.tree.setStyle("_alpha","0"); This
    had some success, but it also removed all color for my depthColors.
    Basically, is there a way to remove background color for the whole
    component and still have depthColors?
    Thanks
    Dave
    However I also want to have

    Chris, first off thank you so much for your patience. I really appreciate it.
    I opened your sample file and it works perfectly. But when I create something similar myself it simply doesn't work. I created a brand new file, inserted an image, and inserted a textbox on top of it. I gave the textbox a white fill, and I copied and pasted your code into the text field's Exit event. And it just doesn't work.
    What's more, I tried copying and pasting your textbox and image into a file of mine, and yours didn't work in my file.
    I have uploaded my sample. I don't know how to attach files to these messages, so you can find it at:
    If you could just take a quick look at it and let me know what I am doing wrong that would be great. I'm sure it's something minor.
    Oh, and for the record, I am using Adobe LiveCycle Designer Version 7, 0, 041126, 0 Cipher: 128-bit, in case that has something to do with it.
    This is driving me up a wall. I thought this would take 2 minutes to do and I have literally spent hours trying to make it work.

  • How to set focus on a textinput/poplist using PPR

    HI,
    Is it possible to use PPR to set focus on a Text input or Poplist.
    if Yes, which attribute in the UI Item we need to use?
    will the attribute 'Access Key' work for the same?
    If PPR is not an option then getting a java bean for the UI Item is the only option?
    Thanks,
    Gowtam.

    Gowtam,
    No, the two basic differences between PPR and fire action!
    1)Fire action submit the entire OA Page Form elements, while PPR only refreshes the form components of that particular region.
    2)When PPR event is done, framework neglects any other action done on the page.
    Now, like your basic question, why should u use PPR event ?Instead y not firaction always?
    The reason is the very first defination of PPR.If i have n number of items on my page, if I define every action as fire action after each event page will refresh, so even for a small update like vanishing a field, i have to refresh the entire page which will be unusual for the user because it will take some time to load if page has some heavy components like hgrids , tables etc. Thats y we prefer PPR event over fire action in case of individual events, which is much fast, refreshing only particular form items.
    In standard j2ee web applications, the same is done using DHTML and javascript.
    I hope i am clear.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How can I set cursor position inside TextInput or TextArea

    Hallo.. I can't find the way for changing che cursor position inside a String in the TextInput or TextArea Component.. I hope you can help me..
    Thx
    Max

    setSelection(index, index);

  • Retrieve changing values from TextInput Flash Component

    Hi,
    I've been banging my head against the wall with this one....
    I've placed aTextInput Flash Component on the stage which
    reads/displays a value from an external text file. So far so good.
    If I enter new text during run-time - editable is set to true
    - the TextInput component updates to reflect what I've typed. BUT,
    how do I retrieve that text to a variable? (I need to save the new
    value back to the external text file).
    Current code:
    myfieldtext = sprite(51).text
    And eventPassMode is set to passAlways
    this retrieves the initial value regardless of what I type.
    Any help appreciated!

    I'm not sure if this all helps, but I had to make a flash
    name input box
    recently. I was getting all sorts of weird results trying to
    get the text
    out of flash. It was giving me all the font info etc, and I
    just needed the
    name. So what I ended up doing is when they were done
    entering the text, I
    put the text into a variable within flash, then pulled the
    data from that
    variable rather than striaght out of the text.
    in director, in the behaviour attached to the flash sprite:
    myText = sprite("nameInput").getVariable( "myNameString",
    True)
    where the sprite is named "nameInput". It seems better to
    name the sprite
    and refer to it that way than using the sprite number, such
    as sprite(51).
    In flash I have the text input field named "textInput", and
    the following
    code attached to the save button. You may have to use a
    different event,
    like when they text input loses focus.
    on (release) {
    var myNameString = "";
    myNameString = textInput.text
    trace(myNameString)
    getURL('event:doEvent,1')
    Timm
    "tayl" <[email protected]> wrote in message
    news:edjutm$ptl$[email protected]..
    > Hi,
    >
    > I've been banging my head against the wall with this
    one....
    >
    > I've placed aTextInput Flash Component on the stage
    which reads/displays a
    > value from an external text file. So far so good.
    >
    > If I enter new text during run-time - editable is set to
    true - the
    > TextInput
    > component updates to reflect what I've typed. BUT, how
    do I retrieve that
    > text
    > to a variable? (I need to save the new value back to the
    external text
    > file).
    >
    > Current code:
    > myfieldtext = sprite(51).text
    > And eventPassMode is set to passAlways
    >
    > this retrieves the initial value regardless of what I
    type.
    >
    > Any help appreciated!
    >
    >
    >

  • Focus on tabNavigator instead of textInput

    I've got a tab navigator with forms inside, something like this:
    <mx:TabNavigator id="tabNav" width="433" height="100%" fontSize="12" fontWeight="normal" creationPolicy="all">
         <mx:Form label="Basic" width="100%" height="100%">
         <mx:FormItem label="Surname" width="100%" height="100%">
              <mx:TextInput id="surnameInput" text="{gridPacjent.selectedItem.nazwisko}" editable="false" width="200"/>
         </mx:FormItem>
         <mx:FormItem label="Name" width="100%" height="100%">
              <mx:TextInput id="nameInput" text="{gridPacjent.selectedItem.imie}" editable="false" width="200"/>
         </mx:FormItem>
         </mx:Form>
         <mx:Form label="Advanced" width="100%" height="100%">
             <some other formItems....>
         </mx:Form>
    </mx:TabNavigator>
    then, on some button press I got this function to set focus on textInput on the first tab:
    private function newPerson():void {    
             surnameInput.editable = true;
             nameInput.editable = true;
             tabNav.selectedIndex = 0;
             //I tried this
             nazwiskoInput.setFocus();
             //and this
             stage.focus = nazwiskoInput;
             //and this
             nazwiskoInput.setSelection(0,0);
    but every solution I try sets the focus on tab navigator's tab instead of a textInput control. Has anyone got any idea how to do it properly?
    The problem appears only when I'm on other tabs. For example: when the component appears on the stage then calling this fuction newPerson() works good - it sets focus on the textInput control. But when I go to any other tab and then call this function it focuses on tab navigator.

    Hi lbarim,
    Checkout this example below...It works even if you navigate to another tab and returns to the original tab...
    Actually I think the problem is coming with the property that you set editable="false" on TextInput...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script>
      <![CDATA[
       private function newPerson():void {    
                surnameInput.editable = true;
                nameInput.editable = true;
                tabNav.selectedIndex = 0;
                surnameInput.setFocus();
                //This below line is required only if you want to put the cursor at the first position of textinput
                //surnameInput.setSelection(0,0);
      ]]>
    </mx:Script>
    <mx:Button label="Set Focus" click="newPerson()"/>
    <mx:TabNavigator id="tabNav" width="433" height="100%" fontSize="12" fontWeight="normal" creationPolicy="all">
         <mx:Form label="Basic" width="100%" height="100%">
         <mx:FormItem label="Surname" width="100%" height="100%">
              <mx:TextInput id="surnameInput" text=""  width="200"/>
         </mx:FormItem>
         <mx:FormItem label="Name" width="100%" height="100%">
              <mx:TextInput id="nameInput" text="" width="200"/>
         </mx:FormItem>
         </mx:Form>
         <mx:Form label="Advanced" width="100%" height="100%">
         </mx:Form>
    </mx:TabNavigator>
    </mx:Application>
    Thanks,
    Bhasker

  • List BackgroundColor?

    When I select some paras and create them into the list.
    (before creating the list,I don't set backgroundcolor deliberately)
    After creating the list,Now I want to set the backgroundcolor of one listitem,
    when setting,I will get an error
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Shape@8a11331 to flash.text.engine.TextLine.
    then, I click DismissAll button,now I remove the list into the paras, but the listitem that I selected just now has a backgroundcolor
    Is it a bug or ...?
    //Note
    1. if it is list ,I can only set color ,but can't set backgroundcolor
    2. if it isn't list , I can set color and backgroundcolor
    P1. select some paras and create them into the list,now click backgroundColor button to set backgroundColor ,I get the error;
    Pic2. I click dismissAll btn,then I remove the list, what can you see? The para that changed from the listitem  has been set the backgroudcolor!!!!!!!!!!!!!!!!!!!!

    I'm not sure what app you are running - can you post a small example showing the crash?  I'm not able to reproduce the problem.
    Thanks,
    Richard

  • Any way to manipulate Insert/Replace mode in TextInput?

    Is it possible to programmatically set Replace mode in TextInput (MX, SDK 3.5) without the user having to press INSERT keyboard button?
    In some cases I'd like to always overwrite text in the input, or at least overwrite it by default.
    Thanks.

    set an empty string to textInput's click property.
    txt.text = " ";
    <mx:TextInput id="txt" text="click here to erase this text" click="clearText(event);"/>
    Check out this example:
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert; 
    private function clearText(event:Event):void{
              txt.text =" ";
     private function showNewText(event:Event):void{        
              Alert.show("New text: " +txt.text);
    ]]>
    </mx:Script>
    <mx:VBox width="100%" height="100%" verticalGap="20" > <mx:TextInput id="txt" text="click here to erase this text" click="clearText(event);"/>
     <mx:Button id="showNewTxt" label="Show Newly Entered Text" click="showNewText(event);" />
    </mx:VBox>
    -Shravan P.
    Message was edited by: Shravan P

  • How to change background color in iWeb Header?

    I cannot change Header background color nor make it smaller.  I've gone into Inspector and zeroed out Header height, nothing changed. Color is problem.

    That the Fine Line theme, correct?  Try this:  delete the shape that's above the navbar. Move the navbar down till you get the right amount of white space above it.  Then use the following code in an HTML snippet to change the navbar background to white:
    <script language="JavaScript" type="text/javascript"><!--
    function navBackgroundColor () {
    elem = parent.document.getElementById('nav_layer');
    elem.style.backgroundColor = "#5D68C3";
    clearInterval(chkNavLink);
    chkNavLink = setInterval('navBackgroundColor()', 500);
    // -->
    </script>
    Change #5D68C3 to #FFFFFF for a white background.  You could try setting backgroundColor = "#5D68C3" to backgroundColor = "" for a transparent background (not sure of this but worth a try).
    OT

  • Cursor focus during a PPR event

    Hi,
    I have two messageTextInput columns (lets say text1 and text2) inside a table region. When a user enters a value in text1 and do a tab out, I fire a PPR event and set some attributes in my VO. The problem is: after it is done, the cursor focus does not move to text2, even though the user did a tab out after entering a value in text1. Cursor focus returns again to text1.
    Also, I do not want to do a page forward, so that processRequest is called again. That would be a costly operation for us. Please let me know if there is a way to regain cursor focus to the right textInput bean.
    Note: This is IE 7.
    Thanks. Much appreciate your inputs.
    Raja

    Raja see this thread, i have replied this some time back:
    Re: How to set focus on a textinput/poplist using PPR
    --Mukul                                                                                                                                                                                                                                                                                                       

  • Change item background color on runtime

    Hello
    i have a List control in my application. What do I have to do
    to change its items background color on runtime?
    Thanks

    You have to access the style of the object and then set the
    piece of the style you want to change. You need to set
    backgroundColor.
    myList.setStyle("backgroundColor", "#ABABAB");
    #ABABAB is grey, and you can put any hex color value there
    you like.
    Hope that helps.

  • Is Parent (Application) is it possible to access child components??

    Hi ,
    In my  MXML Application , is it possible for me to access the child components Data
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
    <mx:Script>
        <![CDATA[
            public function CallMe():void
    // Here i want to access the Canvas TextInput fromCanvas id
        ]]>
    </mx:Script>
        <mx:TextInput x="113" y="128" id="kiran" change="CallMe()"/>
        <local:CC>
        </local:CC>
    </mx:Application>
    =================================================
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" backgroundColor="black">
        <mx:TextInput id="fromCanvas" x="83" y="85"  text="From Canvas"/>
    </mx:Canvas>

    Please help to resolve this : I did the same as what you suggested
    This is my Canvas
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas id="ccCanvas" xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" backgroundColor="black">
    <mx:Script>
    <![CDATA[
    public function get fromCanvasText():String
    return fromCanvas.text;
    ]]>
    </mx:Script>
    <mx:TextInput id="fromCanvas" x="83" y="85"  text="From Canvas"/>
    </mx:Canvas>
    This is my Application (Main)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
    <mx:Script>
        <![CDATA[
            import mx.charts.chartClasses.StackedSeries;
            import mx.controls.Text;
            import mx.resources.Locale;
            import mx.controls.Alert;
    public function callMe():String
        var str:String;
    str =ccCanvas.fromCanvas.toString(); // Error coming here saying that Access of Undefined  Property ccCanvas
    return str;
        ]]>
    </mx:Script>
        <mx:TextInput x="113" y="128" id="kiran" text="{callMe()}"/>
        <local:FF>
        </local:FF>
    </mx:Application>
    Thanks .

  • Simple question: masking text in flex

    I'm sure I'm missing something really obvious on this, so
    forgive me if I have, but is there a way to set the background
    color on text? A label or a text field don't seem to allow you to
    change the background color. So far the only way I can figure out
    to do it is put a label or text field within a tile of the color I
    want, which is cumbersome and difficult to size the way I want etc.
    Is there an easier way?
    M>

    "Developer504" <[email protected]> wrote in
    message
    news:g6lbpe$pcs$[email protected]..
    > I'm sure I'm missing something really obvious on this,
    so forgive me if I
    > have,
    > but is there a way to set the background color on text?
    A label or a text
    > field don't seem to allow you to change the background
    color. So far the
    > only
    > way I can figure out to do it is put a label or text
    field within a tile
    > of the
    > color I want, which is cumbersome and difficult to size
    the way I want
    > etc.
    I think you can use the opaqueBackground property on a label
    to make it
    opaque and then I _think_ you can set backgroundColor on it,
    even though
    this isn't documented.
    HTH;
    Amy

  • Retaining the cursor on a Text Field when error on the field

    Hi,
    We have a requirement, where when we tab out of a text field, the data entered gets validated and exceptions are caught using array list and then thrown on top of the page.
    However, we have a requirement, that on tab out, the cursor should remain in the same field in case there are errors thrown on that field otherwise should move to the next field.
    My Approach is
    1) Capture the tabout event in PFR.
    2) If the validation returns erorr messages, do a forwardImmediately to CurrentPage
    3) Set the focus in PR and throw the exception.
    I read the discussion on the link How to set focus on a textinput/poplist using PPR
    and tried the same approach but below are my observations.
    Approach - 1) WITH FIRE PARTIAL ACTION on text field.
    Input = Invalid, then error message is thrown and I am not able to see the cursor.
    Input =  Valid  , then I see the cursor in the next text field, which is correct.
    Approach - 2) WITH FIRE ACTION
    Input = Invalid, then error message is thrown, the text in the textfield looks selected, which is the required functionality.
    Input =  Valid, then still I see the same text as selected. Here I dont want the text to be selected and want the cursor to move to the next field. This is not happening.
    Please let me know where exactly I am committing the mistake.
    Thanks
    Saurabh
    Edited by: SaurabhAg on Jan 25, 2012 5:53 AM
    Edited by: SaurabhAg on Jan 25, 2012 6:06 AM
    Edited by: SaurabhAg on Jan 25, 2012 6:44 AM

    Can someone please reply to this. Its urgent.
    Thanks
    Saurabh

Maybe you are looking for

  • Dump error while creating Invoicing document

    Moderator note - this is the same problem as identified in thread Error is generated in Print workbench function ISU_INV_BILL_PREPARE.  Thread locked and poster notified of rules violation. Hi Experts, I am new to ISU application.Please provide solut

  • Can't drag disc to trash to eject

    Everyhing seems to be working well with Mavericks except that I can no longer drag a disc to the trash to eject it. I have to quit the app I'm using (Toast, iTunes etc) and then open Disk Utility and select the drive to eject from.

  • I cannot read screen text in Lightroom 5. It is too small.

    I just installed Lightroom 5.3 on my 27" iMac [14,2 OSX 10.9.1]  My eyes are usually about 32" from the screen. Upon installation, I attempted with and without my glasses. I can't read the screen. I increased the font size. There are only two options

  • Laptop computer frozen and trying to reboot but will not. How can I quit and restart?

    How do I restart a computer that is frozen and tries to reboot and will not do anything else? Is there a way to shut it down to restart. I thought I remember there were some keys to shut down and restart. We have disconnected the power and any extern

  • Upload time data with BAPI

    Hi guys, anyone now how to use some of the following bapis? BAPI_PTMGREXTREMSPEC_INSERT BAPI_PTMGREXTREMSPEC_INSWACT BAPI_PTMGREXTREMSPEC_INSWCOST i need to know how to USE this bapis, i dont know how to insert data using this BAPI, wich parameters a