setting actionscript textarea color to black - actionscript-3

I have some simple actionscript 3 code which compiles and runs without error but doesn't do anything. I just want to change the bacground color to black (or transparent). How can this be done?
myTextArea.setStyle("backgroundColor", "0x000000");
I've tried the color argument without quotes and as "black" but nothing seemes to work.

I can't test it right now, but it should be enough to change your code to:
myTextArea.textField.opaqueBackground = 0x000000;
See this link on SO, if you need more help:
How do I change the colours of a textarea in actionscript?

Related

Stripes in background in RDL

Is it possible to add stripes in the textbox in report?
So the result looks like in the picture?
User chooses color for the column in the application
color
This is no built in way of doing this (no fill style) but you could use an image of the stripes as a background image. You would need to create and save images for each colour and style and add them as embedded images in the report.
You can then set the background image of a textbox to the required image.
... or better still use an expression to select the image based on conditions.
=SWITCH(
Fields!ItemCode.Value >10 , "RedStripe",
Fields!ItemCode.Value >50 , "GreenStripe",
True, Nothing
)
Where Redstripe and GreenStripe are the image names you embedded.
You can set the image to repeat etc from the properties panel
Update after OP stated that colour is parameterised.
If the colour is a parameter then we need a slightly different approach.
First you need to create an image with stripes (any colour will do ), and then remove the stripe pixels so that the stipes are now transparent. Save this as a PNG.
I created one quickly whist testing which you can save from here hopefully. You'll just have to move the mouse around in the area below as it's a white on white image! Or switch StackOverflow to the dark theme, then you can right-click and save the image. If not you'll just have to create one yourself.
Image below here.. switch StackOverflow to Dark theme to see it
Image above here..
Now you will need to set the background image to this image but also set the backgroundcolor property to an expression. In this exmaple, I set the background to the value of my parameter.
My parameter is just text and I typed in some hex values in the form #FFFFFF. You will have to work out how to get the value from your color pickers to the report yourself, ask a new question if required.
Here's the report design
and here is the report running using a few sample hex values.

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);

change button color action script 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)

actionscript 3: border for label of progressbar not working

Is there anyone know how to make border for label of progress bar in action script 3? I tried to setStyle("borderColor",#ff0000) but it's not success.
In the example code of the Documentation I see that styles are initialized with the notation 0xAAB3B3.
I would suggest to change the color in your function to 0xff0000.
The 0x means that it's a Hexadecimal number.
You can change the border color of the label of a mx.controls.ProgressBar component using mx.core.mx_internal like this :
progress_bar.mx_internal::_labelField.border = true;
progress_bar.mx_internal::_labelField.borderColor = 0x0000ff;
Hope that can help.

I want each HTML line to alternate in color inside a textbox, back and forth

I have scrolling HTML text in Actionscript 2. How do I make each line alternate colors back and forth (for intended readability)? I don't want to have to code the color for all 600 lines or use mass-replace function, if possible!
Take a look at Zebra striping. You don't need to use Javascript for this. The :nth-child(odd) in CSS should suffice.