Hi there,
Im wondering if its possible to change the setFocus color from black to a different color.
Ive seen it on the web some where but i cant remember where??? does somebody know about this
Not sure what you mean…if you want to change the colour/border of a textfield once it’s got the focus you can use onSetFocus and onKillFocus as per the following quick code:
// set up initial textfields
this.createTextField("first_txt", 1, 10, 10, 300, 20);
first_txt.border = true;
first_txt.type = "input";
first_txt.text = "This is textfield 1";
this.createTextField("second_txt", 2, 10, 40, 300, 20);
second_txt.border = true;
second_txt.type = "input";
second_txt.text = "This is textfield 2";
// set text and border colours to default values when focus is killed
first_txt.onKillFocus = second_txt.onKillFocus = function (newFocus:Object) {
this.borderColor = this.textColor = 0x000000;
};
// set text and border colours to red when textfield has the focus
first_txt.onSetFocus = second_txt.onSetFocus = function (oldFocus:Object) {
this.borderColor = this.textColor = 0xFF0000;
};
If you mean changing the colours when you select text, you can try the approach given here:
http://ericlin2.tripod.com/select/selectt.html
or experiment with the AS 2 class from here:
http://theflashblog.com/?p=173
Finally, if you mean removing the yellow border that can appear around objects that have focus, set the global property _focusrect = false; to turn it off. If you’re planning an application in Flashlite 2.0, you can also change the default _focusrect colour using fscommand2("SetFocusRectColor, <red>, <green>, <blue>); where red, green and blue are values between 0-255.
Hope that all helps.