jefargrafx
Instructor
I have a moveclip that I'm using as a button
I set it tabindex and it will receive tab input and work fine, but I want to move the focus to the button when in appears on the screen. It's part of a error dialog box.
I don't want the user to have to tab throguh all the fields to highlight the button and tehn press enter,
here's the code I have so far let me know what yall think
thanks
onClipEvent (load) {
stop ();
this.focusEnabled = true;
this.tabEnabled = 1;
this.tabIndex = 100;
Selection.setFocus(this);
createTextField("button_text",1,-75,-10.0,150,20);
// button_text.text = "Here's some text";
button_text.html = true;
button_text.htmlText = "<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"CENTER\"><FONT FACE=\"Gill Sans Condensed\" SIZE=\"14\" COLOR=\"#FFFFFF\">OK</FONT></P></TEXTFORMAT>";
button_text.textColor = 0xFFFFFF;
button_text.border = false;
button_text.autoSize = false;
emphasisFormat = new TextFormat();
emphasisFormat.bold = true;
// emphasisFormat.size = 16;
// emphasisFormat.font = "Georgia";
button_text.setTextFormat(emphasisFormat);
}
onClipEvent (enterFrame) {
//button_text_width = getProperty(_level0.new_button_MC.button_text, _width);
this.onSetFocus = function(oldFocus) {
this.gotoAndStop ("over"
;
}
this.onKillFocus = function(newFocus) {
this.gotoAndStop ("up"
;
}
}
onClipEvent (mouseMove) {
if (this.hitTest(_root._xmouse, _root._ymouse, true) && !buttonDown) {
this.gotoAndStop("over"
;
} else if (!hitTest(_root._xmouse, _root._ymouse, true) && !buttonDown) {
this.gotoAndStop("up"
;
}
updateAfterEvent();
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
buttonDown = true;
this.gotoAndStop("down"
;
}
}
onClipEvent (mouseUp) {
buttonDown = false;
if (!this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("up"
;
} else {
this.gotoAndStop("over"
;
}
}
remember this button doesn't display until an error occurs
thanks again jef
I set it tabindex and it will receive tab input and work fine, but I want to move the focus to the button when in appears on the screen. It's part of a error dialog box.
I don't want the user to have to tab throguh all the fields to highlight the button and tehn press enter,
here's the code I have so far let me know what yall think
thanks
onClipEvent (load) {
stop ();
this.focusEnabled = true;
this.tabEnabled = 1;
this.tabIndex = 100;
Selection.setFocus(this);
createTextField("button_text",1,-75,-10.0,150,20);
// button_text.text = "Here's some text";
button_text.html = true;
button_text.htmlText = "<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"CENTER\"><FONT FACE=\"Gill Sans Condensed\" SIZE=\"14\" COLOR=\"#FFFFFF\">OK</FONT></P></TEXTFORMAT>";
button_text.textColor = 0xFFFFFF;
button_text.border = false;
button_text.autoSize = false;
emphasisFormat = new TextFormat();
emphasisFormat.bold = true;
// emphasisFormat.size = 16;
// emphasisFormat.font = "Georgia";
button_text.setTextFormat(emphasisFormat);
}
onClipEvent (enterFrame) {
//button_text_width = getProperty(_level0.new_button_MC.button_text, _width);
this.onSetFocus = function(oldFocus) {
this.gotoAndStop ("over"
}
this.onKillFocus = function(newFocus) {
this.gotoAndStop ("up"
}
}
onClipEvent (mouseMove) {
if (this.hitTest(_root._xmouse, _root._ymouse, true) && !buttonDown) {
this.gotoAndStop("over"
} else if (!hitTest(_root._xmouse, _root._ymouse, true) && !buttonDown) {
this.gotoAndStop("up"
}
updateAfterEvent();
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
buttonDown = true;
this.gotoAndStop("down"
}
}
onClipEvent (mouseUp) {
buttonDown = false;
if (!this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.gotoAndStop("up"
} else {
this.gotoAndStop("over"
}
}
remember this button doesn't display until an error occurs
thanks again jef