I realized I had to import the TextArea class! Thank you Robert!!!
Now, I have two other questions:
The tables have null values so I get an error message when I click on them. How could I make the null values not to prompt the error?
Also, on the previous code, when I created the htmText2 for 2009, it did not let me use to say mytextArea2.htmlText2, because I get a 1119: Access of possibly undefined property reference with static type Class
, but If I create a var htlmText to use it, it says it is a duplicate variable because I had create the same variable for 2007. Here is the code again:
if (yearcombo.selectedItem.year == "2007" && myURL.selectedIndex == 0)
{
fLayer.definitionExpression = "DATA_YEAR_TXT like '2007'"
var graphic:Graphic = Graphic(event.currentTarget);
var htmlText:String = graphic.attributes.htmlText;
var textArea:TextArea = new TextArea();
textArea.htmlText = "<b>Measure: </b>" + graphic.attributes.ForDirIndOut.toString()
myMap.infoWindow.content=textArea
myMap.infoWindow.label = graphic.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));
}
else if (yearcombo.selectedItem.year == "2009" && myURL.selectedIndex == 0)
{
fLayer.definitionExpression = "DATA_YEAR_TXT like '2009'"
var graphic2:Graphic = Graphic(event.currentTarget);
var htmlText2:String = graphic2.attributes.htmlText;
var mytextArea2:TextArea = new TextArea();
mytextArea2.htmlText2 = "<b>Measure: </b>" + graphic2.attributes.ForDirIndOut.toString()
myMap.infoWindow.content=mytextArea2
myMap.infoWindow.label = graphic2.attributes.NAME;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));
}