I forgot the actionscript but what I wanted to do is disable the yellow focus rectangle that comes up on a button when the tab key is pressed. Now, thats easy:
[AS]buttonname._focusrect = false[/AS]
Ok but how do I disable it for everysingle button in the whole movie? And where do I put this actionscript? In the first keyframe?
I think the action script may have to do with proto or prototype, I don’t wanna ask people on Newgrounds how to do it. Thanx.
yea thats the right syntax, you can put it on a blank keyframe, or where there is already code. i think you can put all ur buttons in a an array and just say
[AS]for (name in _root) {
if (typeof (_root[name]) == “object”) {
_root[name]._focusrect = false;
}
}[/AS]i think this will disable focus on all button + textfields + objects in _root
:-\
I was about to post this:
[AS]MovieClip.prototype.enableFocusRect = function() {
for (var prop in this) {
if (this[prop] instanceof MovieClip) {
this[prop].enableFocusRect(arguments[0]);
} else if (this[prop] instanceof Button) {
this[prop]._focusrect = arguments[0];
}
}
};
// example
_level0.enableFocusRect(false);[/AS]
Hey cladio - what do u mean thatll exclude the button in automatic tab ordering?
Hey kax…thanks a lot. The button.prototype.tabenable=false thingy works perfectly now. But you’re sure it works for everysingle button right? What about for buttons inside symbols, and buttons in other scenes?
It’s a method that will loop through all the objects. If the object is a MovieClip, it will call the method; if the object is a Button, it will set to false (or true, depending on the parameter passed to the function (kind of obvious, isn’t it?)) its _focusrect property.