How to set alpha to TextField?

I've created a txtField with background set to true,
backgroundColor set to a certain color, and txtField.alpha set to
10; however, the alpha does not work. The background color of
txtField appears to have a full opaque color and not transparency.
Any suggestion is appreciated.

I've had issues with textfields before and alpha - never
using background colours but this may help....
I found that alpha only works with textfields if the
textfield uses embedded fonts.
import a font to you library - export for actionscript call
it myFont.
import myFont;
var myFontImport:String = new myFont().fontName;
var theFormat:TextFormat = new TextFormat();
theFormat.color = 0xFFFFFF;
theFormat.size = 14;
theFormat.font = myFontImport;
myTexField.embedFonts = true;
myTexField.text = "some text here";
myTextField.setTextFormat(theFormat);
myTextField.alpha = 0.1;
Remember the alpha is between 0 and 1 NOT 0 and 100
Greg

Similar Messages

  • How to set a dynamic textfield?

    How to set a dynamic textfield that can baseon the user input data to resize the textfield height and width? Beside, I would like to copy the MS word table into the Form textfeild with the original design, how to do that? Many thanks!

    You need to check two things:
    1- Make sure to check the "Allow Multiple Lines" under the object tab.
    2- Check the Expand to Fit checkboxes under the layout tab.
    Jasmin

  • How to set alpha or transparency of ComboBox

    Hi,
    I'm using AS2 with Flash CS4. How can I change the alpha of a ComboBox?
    I tried:
    MyCombo._alpha = 25;
    // and
    MyCombo.alpha = 25;
    but both have no effect on my ComboBox, it just appears to have the alpha set to 100.
    Many thanks in advance

    Nevermind, I solved it by not using _root. in front of the combobox name.
    Does anyone know how to set the alpha of the background only of a combobox? Currently the entire combobox is being faded so the text and border is hard to see.

  • How to change alpha of textfield

    Forum Members,
    I have looked around, and not really found an answer to this
    question. It seems it can be done, but I am
    not sure how to do it.
    I would like to emulate Powerpoint in flash, in the sense of
    having text appear on the stage.
    In one case I have created a textfield,
    var myTextField:Textfield = new Textfield();
    I am able to assign a format to the textfield using the
    TextFormat class.
    and tween it around, etc.
    I am reading an xml file to set another textfield's text
    value.
    I would like to change the alpha of this textfield (var
    subText:TextField = new TextField();)
    to zero, and then tween it up to 1 (using tweenlite).
    I do not seem to be able to set the alpha on the textfield.
    Is this possible? I do not want to convert it to a MovieClip or
    Sprite, but if that is what I need to do to get the ability to
    change the alpha, I will do it.
    Thanks,
    Eholz1

    you can assign its alpha property like any display object.
    you just need to embed its font.

  • How to set alpha channel names in a format plugin?

    I am writing a format plugin with 6 color planes for CMYK mode. I want to set the apha channel names for planes 5 and 6 to "White" and "Clear" instead of "Alpha 1" and "Alpha 2" when I read the color data from my file. How do I set the alpha channel names?
    Thanks!

    I am still trying to find a solution to this.  The propChannelName is read only and the documentInfo structure is NULL when reading.  Any suggestions?

  • How to set textField.Background alpha?

    Is there a way to set the alpha of textField.Background to say 30? I already have the following:
    txtField.background = true;
    txtField.backgroundColor = 0xEE9A00;
    All I need is a way to set the background so that it's not 100% opaque?

    quote:
    Originally posted by:
    kglad
    you have to fake it. add a sprite behind your textfield and
    assign its color/alpha to suit your needs.
    actually i was doing in flex before this.
    i dont know what is sprite and other stuffs.
    my class extends sprite and adds a TextField Child.
    hence, as much i can understand is there is already a sprite.
    can u pls elaborate how to change your suggestion to CODE so
    that i can try.

  • How to set width of a TextField ?

    Hi all,
    I want to use Polish in my javaME code , so I add //#style style_name before calls of constructor TextField.
    The problem is that when I run the application then the textfield is very small in width ! And when I try to enter a value inside then a big textarea is shown in the screen in which I enter the value ; and after that I click the "Ok" command item and I finally return to my form.
    I use a polish.css file to define the style.
    So how to set a width for a TextField ?
    Thank you very much indeed

    never mind. I forgot a line in my layout manager.

  • How to set alignment in a TextField?

    I need to set allignment of the text in a TextField to right. There is no such under TextField.
    Anybody knows how to set alignment in a textfield in javaFX 2.0 ?
    Thanks

    It may be worth filing a feature request jira to get platform native support for this.
    You might think that textField.setStyle("-fx-text-alignment: right;") would work, but it does not.
    I guess that the -fx-text-alignment css property only right aligns multi-line text, not text within a text field.
    The following code uses binding to keep Text in a TextField right aligned.
    The translations place the text visually right and keyboard editing is OK.
    Mouse transparency is enabled because mouse based selections still act as though the text is left aligned.
    So it's not a complete solution.
    public void start(final Stage stage) throws Exception {
      // create a text field.
      final TextField textField = new TextField("This is right aligned text");
      textField.setStyle("-fx-text-alignment: right;");
      textField.setMinWidth(400);
      textField.setMouseTransparent(true);
      // layout the scene.
      final VBox layout = new VBox();
      layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10; -fx-alignment: center;");
      layout.getChildren().addAll(textField);
      Scene scene = new Scene(layout);
      stage.setScene(scene);
      stage.show();
      // keep the text in the textbox right aligned.
      final Text text = (Text) textField.lookup("Text");
      rightAlign(text, textField);
      textField.textProperty().addListener(new InvalidationListener() {
        @Override public void invalidated(Observable observable) {
          rightAlign(text, textField);
    private void rightAlign(Text text, TextField textField) {
      text.getParent().translateXProperty().bind(textField.widthProperty().subtract(text.xProperty().multiply(2)).subtract(text.getLayoutBounds().getWidth()));
    }

  • How can I set focus on TextField?

    Hi,
    I can't find a method or solution to set focus on TextField,I'd like to set the cursor into a special TextField when user enter my form.how can i implement this functionality?
    Any suggestion?
    Hanlin Li.
    Edited by: noob on Apr 13, 2012 4:28 PM

    textField.requestFocus();

  • How to set max rows in flowed textfield?

    Is there a way to limit the rows allowed to input on a flowed textarea? I now we can limit the length of max chars, but that would not help me.

    Hi Rishit,
    Thanks for your answer!
    Had a long holiday, so didn't give a feedback in time. Sorry for that!
    There is a tab 'Controls' in Universe Parameter, where there is a setting used to limit the size of result set.
    Then what's the priority between this setting and the similar setting in WebI query properties?
    However, acutally my question is how to set the limitation by user security profile in CMC.
    Do you have any idea about it?
    Qing
    Edited by: Qing Zhou on Jun 21, 2010 11:12 AM

  • How to Set the Text of an Onstage TextField?

    I'm trying to set an onstage TextField instance's "text" property, while maintaining embedded fonts and its onstage appearance.
    Problem Encountered: Text doesn't show up when setting text via ActionScript on an on-stage TextField w/ embedded text.
    Workaround: Create and assign a TextFormat object:
    defaultTextFormat = new TextFormat('Arial', 100, 0x000000, true, true);
    Annoyance: This defeats the purpose of styling text with the IDE.
    Possible Solution: Import the embedded font to the library and export for ActionScript?

    My problem was actually that merely setting the *text* property caused my dynamic TextField w/ embedded font to not display any text. BUT, I just re-tested this with a new file, and the problem doesn't occur. Only thing I can think of is -- my FLA was created with an older version of Flash... possibly MX 200(4?). Could this be the issue?

  • How to set the background for all components?

    hi
    Does anybody know how to set the DEFAULT background color in an application.. I need it because in jdk 1.3 the default bgcolor is grey and in 1.5 it is white.. and I wish white as well.. so to make it also white in jdk 1.3 I need to use the (a bit annoying) anyContainer.setBackground( Color.white ); and these are lots in my app.. So my question is: is there such an overall class with a function (say UIManager.setComponentsBackground( Color color ) ) for such a purpose?
    any tip or link would be greatly appreciated

    Does anybody know how to set the DEFAULT background color in an applicationthis might get you close
    import java.awt.*;
    import javax.swing.*;
    import java.util.Enumeration;
    class ApplicationColor extends JFrame
      public ApplicationColor()
        setApplicationColor(Color.RED);
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel jp = new JPanel(new BorderLayout());
        jp.add(new JTextField("I'm a textfield"),BorderLayout.NORTH);
        jp.add(new JComboBox(new String[]{"abc","123"}),BorderLayout.CENTER);
        jp.add(new JButton("I'm a button"),BorderLayout.SOUTH);
        getContentPane().add(jp);
        pack();
      public void setApplicationColor(Color color)
        Enumeration enum = UIManager.getDefaults().keys();
        while(enum.hasMoreElements())
          Object key = enum.nextElement();
          Object value = UIManager.get(key);
          if (value instanceof Color)
            if(((String)key).indexOf("background") > -1)
              UIManager.put(key, color);
      public static void main(String[] args){new ApplicationColor().setVisible(true);}
    }

  • How to set up connection between S and C

    I want to realize a chat between server and client.
    on both side ,there is a textArea to get the information to send to the other.
    I know the socket is must be used,but how to set up the data source(from textarea or textfield),and how to store the data?
    can some one tell me how to do this?
    thanq!

    So what are you saying you dont know how to use the textarea and textfield?Cause it is ez to convert that code that dunedinhigh gave you from console to a gui like what you want I think.So here is a link that shows you how to use text component.You learn this then you can put 2 and 2 together.Also check out the java tut page.
    http://java.sun.com/docs/books/tutorial/
    http://java.sun.com/docs/books/tutorial/uiswing/components/simpletext.html
    good luck

  • How to set the View instance and view  attribute to lov field ?

    Hi
    I created lov and textfield programatically.
    I want to set the viewattribute and view instance to that items(lovbean, texfieldbean).
    How to set programatically?
    Thanks in Advance
    Awadesh

    Hi
    Thanks. Its working fine. But now i got some another issue.
    after setting, i put simple system.out.println(Pagecontext.getparameter("idoflov"));
    But it returns null value.
    why. Actully i want to pass this value (according to my requirement).
    The view instance and view attribute are setting correctly. But after that i checked means it returns null value .
    plz let me know.
    Thanks

  • How to display " ****" in a TextField?

    Hello,
    How do I make a TextField to behave like a password field. i.e when the user enters some text into it the textfield, the text should be displayed in the form of " ****** ". Can any one help me by giving some source code?
    Thanks
    [email protected]

    Kenny's idea is the easiest and best. If you have a reason that you don't want to do this, subclass JTextField, add a KeyAdapter, and whenever you get a key event of a character being entered, you can edit the contents of the text field using it's set methods.

Maybe you are looking for