change button color action script 3 - actionscript-3

btnPlanet.mouseEnabled = false;
btnPlanet.mouseChildren = false;
i have button and it's called btnPlanet, i want to change button color when they are disabled, but the button contain text, that if i change button color using colorTransform, it make my text dismissed, and filled with color that i use from colorTransform, can i change only color of shape in button without change text color? or make it grayscale at least? thank you, i'm sorry if i have bad grammar english

Apply alpha/colorTransform/whatever to everything EXCEPT text field.
Is it your own button or you're using some kind of component?
If it's your own I bet you have something like background for shape and TextField on top of that.
If it's a component I'm pretty sure you should be able to access it as well.

that's not hard.set instance name of your shape in your button for example myShape. Then write:
btnPlanet.myShape.transform.colorTransform=new ColorTransform(your colortransform settings)

Related

Change font color of TextButton on click?

I've read some tutorials and documentation on scene2d's UI capabilities, but I can't quite figure out how the skins work. I simply want a TextButton that changes color when pressed. I managed to get the background of the TextButton to change, but that's not what I wanted. It should have no background.
I would be very grateful if anyone could provide an example of how this could be done. It seems very simple, so I think I'm missing something obvious here. If a skin is involved, please write it programmatically.
Thank you.
Turns out it was as simple as I thought, it just didn't work when I tried it the first time.
When defining the TextButtonStyle you can assign downFontColor the color you want your text to be while it is being pressed. You can also assign checkedFontColor the color you want the text toggle between when pressed.
Example:
TextButtonStyle textButtonStyle = new TextButtonStyle();
textButtonStyle.font = someBitmapFont;
textButtonStyle.fontColor = Color.WHITE;
textButtonStyle.downFontColor = Color.BLACK;
//Optional color to toggle between when pressed
textButtonStyle.checkedFontColor = Color.GREEN;
final TextButton textButton = new TextButton("Text", textButtonStyle);
This will produce a white TextButton that turns black when it is pressed. When the mouse/touch is released it'll either turn green or white, depending on the state of the toggle.
You can also tint it, but the effect depends on the base color (if it is white, then it works perfectly, else it depends). Anyway, it's done like this:
button.getLabel().setColor(myColor);

flex - how to set the background color of a spark check box text label?

I have a simple spark mxml check box and I want to change the background color via actionscript. I have searched and tried many suggestions, including using setStyle with 'background-color', 'chromeColor', symbolColor and others like this - the only thing that worked at all is chromeColor, which colored the box but not the text or background:
insUpdatedCB.setStyle('chromeColor','yellow');
I also tried using text format like this:
var myTf:TextFormat = new TextFormat();
myTf.size = 16;
myTf.color = 0xFF0000;
insUpdatedCB.setStyle("textFormat", myTf);
also did not work
how can I set the label/text background color?
If you want to change the background color of the spark checkbox, then you have to apply a custom skin for it. Make a new Custom skin by making a copy of default checkboxSkin for spark checkbox, and then change the background color of the label in the Custom Skin.

How to Change Text Cursor Color of Text Input Flex 4?

I want to change the blinking text cursor color of Text Input in Flex 4...
How can I change it ?
Is there any way to handle it, or it can be only controlled by Flash Player ???
I had a similar question about this a while ago. I never found a way to update the actual cursor, so I got creative with the solution. My solution was to have two textfields stacked. One input field on top of a dynamic field.
Set the alpha of the input field to 0. Then, add a CHANGE event listener to the input field. In the handler, update the dynamic field and reposition your cursor based on the textWidth.
Not ideal, but it did the job.
I had solved this problem,
Actually there was a problem in skinning of text input.
If we set textinput skin's richeditabletext's alpha to 75 or some down value, flash player makes cursor color white itself.
So by increasing that alpha value, I got the cursor color black.
I change the TextField.textColor = OxFFFFFF, the cursor changes into white as well. Works for my case when I need the same color for the blinking cursor and text.

how do I add text to a button?

This should have a really obvious answer but I can't figure it out...
I've made a button in Access 2007 that takes the user to a form (and other buttons that do other things). I've made the button's background an image so that I could have a gradient-style button but I'd also like to have text on top of this. There is text on the button but it gets hidden either because it's just a name given to the button for VB or because the gradient image is being place on top of it...
any ideas?
Access 2010, and Access 2007 supports both text and graphics on buttons.
Eg note the top buttons:
or simply this:
I do believe that transparency in 2010 is better supported, and the options for buttons in 2010 does include shadow and gradient options:
Eg:
I'm not sure how you did set picture as button background. Might be do you mean that you have two independent controls, an image and a button. In this case right click on the image and Position / Send to back. Back style of the button should be Transparent, but Transparent property should be set "No".

Can you change the default color for selected text in MS Access?

I haven't found an existing post about this so I'll give it a shot.
I'd like to know if there is a way to change the default highlight color for selected text? Right now, whenever I invoke .SetFocus on a field, Access "selects" the contents of the field. The color it uses is black, and makes the data very hard to see. Is there a way to change that color?
Access simply swaps the background and foreground color as its means of highlighting text in a text box. As far as I know there is no way to change this behavior.
Obviously you can change the foreground and background colors themselves, but there is no separate "highlight" color that you can set independent of the foreground/background.
Although this isn't specificity for List Boxes I still think it is worth a note that List Boxes work slightly different (not sure why... maybe a different developer!) the selected row on a list box will inverts the colour of the background and foreground separately instead of swapping them.
For example if you had a light blue text on a white background normally the selected row would be a red text on a black background. The white inverts to black and the light blue inverts to red.
Or if you had
Not sure which method I like better but it would be nice if they where the same! Makes UI's look a lot better when they are consistent throughout the form!
Sometimes this problem can be caused by using a transparent text box on a background that is the same or similar color (with contrasting-colored text). Make sure you have the text box back color set to a same/similar color as the background.
Basically, you need the text box back color to contrast with the text. When highlighted, the highlight will be a contrasting color to the text box background color.