-
[RESOLVED] set style for disabled check boxes
I'm trying to set the style for a check box, works fine when the check box is enabled, but once disabled the check box reverts back to its default disabled style.
How do I change the style for disabled check boxes?
Here is the code I used for defining the style and setting it to the checkbox:
Code:
var msg_frmt:TextFormat = new TextFormat("Verdana",10,0xFFFFFF,null,null,null,null,null,"left",null,null,null,null);
var chkbox:CheckBox = new CheckBox();
chkbox.setStyle("textFormat",msg_frmt);
-
Senior Member
Why not just change the skin for the disabled box?
-
I'm not sure what you mean, when I edit the symbol from the library there is no section to modify the text, but you can edit everything else :-\
-
Señor Member
I was also wondering how to do this... have you tried setting the textformat after disabling the box? Let me know when you figure it out.
Haikus are easy
But sometimes they don't make sense
Refrigerator
-
Senior Member
Okay, sorry for taking so long to get back to you. Been a busy weekend moving and all, LOL.
Anyway, to set the disabled text format you'll want to do something like this:
Code:
import fl.controls.*;
var c1:CheckBox = new CheckBox();
var txt1:TextFormat = new TextFormat();
txt1.color = 0x006600;
addChild(c1);
c1.enabled = false;
c1.setStyle("disabledTextFormat", txt1);
Also, you could just set the label to nothing and draw your own textfield and position it and set it's styles as well.
Also, a tip if you'd like. If you go into your program files to the adobe folder and look at the components source code, you can find the specific names of all the classes involved.
Hope this helps. Let me know.
-
hey jweeks, thanks for getting back to me hope the move went well.
My checkboxes are generated dynamically so it would be a hassle, but the disabledTextFormat workeded!
-
Senior Member
Cool, glad to help, and yep, aside from a sore back, went well, LOL. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|