View Full Version : vexed by text rects
zack27
02-10-2004, 12:24 PM
I know that you can disable the yellow rectangle around buttons/mc's with the _focusrect property, but how do you get rid of the green rects that appear when you tab through input text??
Thanks people!
-Zack
farafiro
02-11-2004, 03:13 AM
with the same way, the _focusrect
zack27
02-11-2004, 05:47 PM
it seems that in mx2004, that way only works with buttons and mc's, not textboxes, no?
zack27
02-11-2004, 09:11 PM
it seems that this disables it:
text.onSetFocus = function() {
text._focusrect = false;
};
farafiro
02-12-2004, 02:56 AM
lol
so u got it yourself
;)
u can also try this
TextField.prototype.onSetFocus = function(){
_focusrect = false
}
Maynard
03-02-2004, 11:51 AM
Hi there - the above mentioned suggestions are not working for me. I'm using MX2004 Pro and I do not want the green highlight color around my textinput boxes, buttons, or my comboboxes.
Please Help!:confused:
farafiro
03-03-2004, 02:39 AM
either use the code I've posted in the first frame of the movie
or
put it in a class and import it into your movie
Maynard
03-03-2004, 12:25 PM
Thanks for your response!:)
But I'm missing something and the green focus box still surrounds the components when I tab to them. Would you take a look at my code and see if my error is apparent? There is only one frame in the movie. Thanks again.
TextField.prototype.onSetFocus = function(){
_focusrect = false
}
this.attachMovie("TextArea", "HeaderText", 11);
HeaderText._x = 10;
HeaderText._y = 0;
HeaderText.setSize(520, 25);
HeaderText.backgroundColor = 0xCCCC99;
HeaderText.setStyle("borderStyle", "none");
HeaderText.editable = false;
HeaderText.html = true;
HeaderText.text = "<font face='Arial' size='18'><b>Employment Opportunities - Admin Section</b></font>";
this.attachMovie("TextArea", "StaffLabel", 31);
StaffLabel._x = 10;
StaffLabel._y = 35;
StaffLabel.setSize(340, 40);
StaffLabel.wordWrap = true;
StaffLabel.backgroundColor = 0xCCCC99;
StaffLabel.setStyle("borderStyle", "none");
StaffLabel.editable = false;
StaffLabel.html = true;
StaffLabel.text = "<font face='Arial' size='12'><b>Choose a position, enter the closing date in the form box and click sumbit to display the job.</b></font>";
this.attachMovie( "List", "employeeBox", 41);
employeeBox._x = 10;
employeeBox._y = 80;
employeeBox.setSize(335);
employeeBox.fontSize = 10;
employeeBox.color = 0x000000;
employeeBox.selectionColor = 0x000000;
employeeBox.rollOverColor = 0xCCCCCC;
employeeBox.textRollOverColor = 0x000000;
employeeBox.textSelectedColor = 0xFFFFFF;
employeeBox.rowHeight = 17;
employeeBox.rowCount = 7;
employeeBox.setEditable(false);
employeeBox.change = function(eventObj){
chooseEmployee();
}
employeeBox.addEventListener("change", employeeBox);
function ListJobs(){
getStaffVars = new LoadVars();
getStaffVars.onLoad = function () {
loop = eval("this.rows");
for (var i = 2; i <= loop; i++) {
jtitle = eval("this.jobtitle" + i);
jnumber = eval("this.jobnumber" + i);
grade = eval("this.grade" + i);
employeeBox.addItem(jtitle, jnumber);
}
}
getStaffVars.load("http://www.pbjcal.org/listjobs.php");
}
ListJobs();
this.attachMovie("TextArea", "JobLabel", 101);
JobLabel._x = 10;
JobLabel._y = 215;
JobLabel.setSize(80, 20);
JobLabel.backgroundColor = 0xCCCC99;
JobLabel.setStyle("borderStyle", "none");
JobLabel.editable = false;
JobLabel.html = true;
JobLabel.text = "<font face='Arial' size='11'><b>Job Title:</b></font>";
JobLabel.onSetFocus = function() {
JobLabel._focusrect = false;
}
this.attachMovie("TextArea", "ClosingLabel", 111);
ClosingLabel._x = 10;
ClosingLabel._y = 240;
ClosingLabel.setSize(80, 20);
ClosingLabel.backgroundColor = 0xCCCC99;
ClosingLabel.setStyle("borderStyle", "none");
ClosingLabel.editable = false;
ClosingLabel.html = true;
ClosingLabel.text = "<font face='Arial' size='11'><b>Closing Date:</b></font>";
this.attachMovie("TextInput", "PosTitle", 125);
PosTitle._x = 100;
PosTitle._y = 214;
PosTitle.setSize(240, 20);
PosTitle.fontSize = 10;
PosTitle.color = 0x000000;
PosTitle.tabIndex = 1;
PosTitle._focusrect = false;
this.attachMovie("TextInput", "JClose", 115);
JClose._x = 100;
JClose._y = 239;
JClose.setSize(160, 20);
JClose.fontSize = 10;
JClose.fontFamily = 'Arial';
JClose.color = 0x000000;
JClose.tabIndex = 2;
this.attachMovie( "ComboBox", "categoryBox", 141);
categoryBox._x = 100;
categoryBox._y = 265;
categoryBox.setSize(160, 19);
categoryBox.fontSize = 10;
categoryBox.setStyle("color", "0x000000");
categoryBox.selectionColor = 0x000000;
categoryBox.rollOverColor = 0xCCCCCC;
categoryBox.textRollOverColor = 0x000000;
categoryBox.textSelectedColor = 0xFFFFFF;
categoryBox.rowHeight = 17;
categoryBox.rowCount = 7;
categoryBox.setEditable(false);
categoryBox.addItem("New Listings", 1);
categoryBox.addItem("IT", 2);
categoryBox.addItem("Professional", 3);
categoryBox.addItem("Non-Professional", 4);
categoryBox.addItem("Healthcare", 5);
categoryBox.addItem("Provisional", 6);
categoryBox.addItem("Promotional", 7);
categoryBox.tabIndex = 3;
this.attachMovie("Button", "addJob", 201);
addJob._x = 110;
addJob._y = 290;
addJob.setSize(100,18);
addJob.label = "Add to List";
addJob.fontSize = 10;
addJob.color = 0x000000;
addJob.tabIndex = 4;
text.onSetFocus = function() {
text._focusrect = false;
}
this.attachMovie("TextArea", "OpportLabel", 301);
OpportLabel._x = 370;
OpportLabel._y = 55;
OpportLabel.setSize(230, 18);
OpportLabel.wordWrap = true;
OpportLabel.backgroundColor = 0xCCCC99;
OpportLabel.setStyle("borderStyle", "none");
OpportLabel.editable = false;
OpportLabel.html = true;
OpportLabel.text = "<font face='Arial' size='12'><b>Employment Opportunity:</b></font>";
this.attachMovie("TextArea", "DateLabel", 311);
DateLabel._x = 625;
DateLabel._y = 55;
DateLabel.setSize(130, 18);
DateLabel.wordWrap = true;
DateLabel.backgroundColor = 0xCCCC99;
DateLabel.setStyle("borderStyle", "none");
DateLabel.editable = false;
DateLabel.html = true;
DateLabel.text = "<font face='Arial' size='12'><b>Closing Date:</b></font>";
this.attachMovie("TextArea", "JobsText", 321);
JobsText._x = 360;
JobsText._y = 80;
JobsText.setSize(380, 136);
JobsText.wordWrap = true;
JobsText.editable = false;
JobsText.html = true;
function GetJobs(){
getJobsVars = new LoadVars();
getJobsVars.onLoad = function () {
loop = eval("this.rows");
for (var i = 1; i <= loop; i++) {
jtitle = eval("this.title" + i);
jdate = eval("this.date" + i);
grade = eval("this.category" + i);
JobsText.text = JobsText.text + "<font face='Arial' size='11'><textformat leftmargin='10' rightmargin='10' tabstops='250'>" + jtitle + "<tab>" + jdate + "</textformat></font>";
}
}
getJobsVars.load("http://www.pbjcal.org/getjobs.php");
}
GetJobs();
function chooseEmployee(){
jname = employeeBox.getSelectedItem().label;
PosTitle.text = jname;
}
farafiro
03-04-2004, 02:15 AM
lol
sure for the prototype I've posted belongs to the TextField class, not the TextArea class
;)
Maynard
03-04-2004, 09:05 AM
OK - In the above code I've changed TextField.prototype to TextArea.prototype and also tried changing it to TextInput.prototype, however, the focus boxes still appear. :confused:
Am I making the change correctly for AS2? Your help is very much appreciated.:D
farafiro
03-04-2004, 09:19 AM
yup Maynard
u should extend the textArea class for this, this means you should make a *.as file doing this
something likenoRect class extend TextArea{
this._focusrect = false
}
Maynard
03-04-2004, 10:00 AM
Thanks farafiro - still having trouble:(
I've created an .as file as follows:
noRect class extend TextArea {
this._focusrect = false;
}
When I include the as file, I'm getting an error message stating:
Syntax error:
noRect class extend TextArea {
It appears to think that I'm not closing my class definition.
I receive error messages for the other code statements saying:
Syntax error:
This statement is not permitted in a class definition.
Have I included the as file improperly?
Thank you again
splict
03-04-2004, 02:26 PM
extends
farafiro
03-07-2004, 02:24 AM
Ooooops
what a shame
sorry, I wear glasses
Maynard
03-18-2004, 12:19 PM
OK - after taking some time off from this disappointing and frustrating problem - I've come to ask for help again.
I've posted my code above and I'm asking anyone to please explain and provide code to prevent the unspeakably ugly and unnecessary green focus rectangles from appearing around the V2 components in a form. Currently, I'm having to use MX with as1 to create all my forms while using as2 and MX 2004 for my other pages. The lack of documentation on as2 regarding this is disheartening and I would be grateful for suggestions or links which can solve this problem.
Thanks again.
Maynard
02-02-2005, 08:23 PM
For those interested in removing the green focus box from around v2 components. I decided to try again with this little nuisance and I found this solution on a forum thread at flashmx2004.com - hope it helps.
myComponent.drawFocus="";
And for a comboBox:
myComboBox.drawFocus = "";
myComboBox.dropdown.drawFocus="";
Alphasnail
09-27-2005, 04:49 PM
Thanks for adding your solution! It worked perfectly for me.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.