Solved! Go to Solution.
htmlText = '<a href="' + match[1] + '" target="_blank">' + match[1] + "</a>";
htmlText = '<a href="' + match[1] + '" target="_blank">' + match[1] + "</a>";
var formItem:FormItem = new FormItem();
formItem.label = fieldInfo.label || fieldInfo.fieldName;
var label:mx.controls.Label;
htmlText = formattedAttributes[fieldInfo.fieldName];
if (htmlText)
{
// convert attribute field values that just contain URLs into links
var match:Array = htmlText.match(/^\s*((https?|ftp):\/\/\S+)\s*$/i);
if (match && match.length > 0)
{
label = new mx.controls.Label();
htmlText = '<a href="' + match[1] + '" target="_blank">' + match[1] + "</a>";
}
else
{
label = new Text();
}
cleanAndSetHtmlText(label, htmlText);
label.selectable = true;
label.styleSheet = this.textStyleSheet;
label.width = 350;
formItem.addChild(label);
//my additions
var matchTwo:Array = htmlText.match('GREENBRIAR');
if (matchTwo && matchTwo.length > 0)
{
label = new mx.controls.Label();
htmlText = '<a href="http://www.google.com" target="_blank">' + matchTwo + "</a>";
}
else
{
label = new Text();
}
cleanAndSetHtmlText(label, htmlText);
label.selectable = true;
label.styleSheet = this.textStyleSheet;
label.width = 350;
formItem.addChild(label);
//end my additions
}
descriptionForm.addChild(formItem);
}
}
}
var formItem:FormItem = new FormItem();
formItem.label = fieldInfo.label || fieldInfo.fieldName;
var label:mx.controls.Label;
htmlText = formattedAttributes[fieldInfo.fieldName];
if (htmlText)
{
// convert attribute field values that just contain URLs into links
var match:Array = htmlText.match(/^\s*((https?|ftp):\/\/\S+)\s*$/i);
//Start My Addition
var matchTwo:Array = htmlText.match('GREENBRIAR');
//End My Addition
if (match && match.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="' + match[1] + '" target="_blank">' + match[1] + "</a>";
//Start My Addition
}else if (matchTwo && matchTwo.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="http://www.google.com" target="_blank">' + matchTwo + "</a>";
//End My Addition
}else{
label = new Text();
}
cleanAndSetHtmlText(label, htmlText);
label.selectable = true;
label.styleSheet = this.textStyleSheet;
label.width = 350;
formItem.addChild(label);
}
descriptionForm.addChild(formItem);
}
}
}