Hi,
I have a menu made with AS 2.0 that gets its values from an xml file, its a collapsable menu and I want the secondary nav (or sub nav) not only to indent but to be a different colour?
Heres the code I’m trying to alter-
TextFieldClass.prototype.drawText = function(newName, x, y, w, h) {
// ---set unique depth to attach at
++this.depth;
// ---basic MX create blank textfield method
this.tempText = this.createTextField(newName, this.depth, x, y, w, h);
// ---link between new textfield and parent Object
this.tempText.parent = this;
// ---set textfield type: "dynamic" or "static" or "input"
this.tempText.type = this.fieldType ? this.fieldType : "dynamic";
// ---allow cursor selection of text
this.tempText.selectable = false;
// ---specify HTML text
this.tempText.htmlText = this.title;
// ---control textfield background colour
if (this.applyBground) {
this.tempText.background = false;
// ---background colour matches button background colour
this.tempText.backgroundColor = parseInt(this.blurColour);
// ---would only apply if textfield was "input" type and selectable
if (this.applyFocus) {
this.tempText.onSetFocus = this.handleFieldFocus;
this.tempText.onKillFocus = this.handleFieldBlur;
}
}
// ---embed fonts for antialiasing
// this.tempText.embedFonts = true;
// ---specify password type textfield
this.tempText.embedFonts = true;
if (this.protect) {
this.tempText.password = true;
}
// ---define appearance of textfield content
this.styleObj = new TextFormat();
this.styleObj.font = "Helvetica Neue";
this.styleObj.size = 12;
this.styleObj.bold = true;
this.styleObj.leading = -30;
// if this is a secondary button, indent by 5 pixels
this.styleObj.indent = this.applyindent ? 15 : 5;
// ---apply style to textfield
this.tempText.setTextFormat(this.styleObj);
};
// ---[method] changes textfield background colour on focus
TextFieldClass.prototype.handleFieldFocus = function() {
this.backgroundColor = this.parent.focusColour;
};
// ---[method] changes textfield background colour on blur
TextFieldClass.prototype.handleFieldBlur = function() {
this.backgroundColor = this.parent.blurColour;
};
// ---test whether textfield contains text, returns a boolean
TextFieldClass.prototype.isEmpty = function() {
if (this.txt.text == "") {
return (true);
break;
}
return (false);
};
It says that he uses this code to indent the sub nav-
// if this is a secondary button, indent by 5 pixels
this.styleObj.indent = this.applyindent ? 15 : 5;
so I’ve tried similar things to that but with colour specifications instead but still no luck, any ideas? Its probably pretty simple but I can’t seem to get it to work?