I have an if/else if/else if/else if/else statment in AS3.
It's a calendar that reads in dates from an xml file. The if/else if/else statements controls the look of a date according to whether it has an event, and whether it's past/present or future. The MouseEvent is a tooltip which shows the Event information.
The last section is
else {
var thisday:String = "<b><font color=\"#666666\" size=\"9\"> <u><font size=\"12\"> -</font> " + yy + " <font size=\"12\">-</font> " + GlllStringUtil.checkDigits((mm + 1).toString()) + " <font size=\"12\">-</font> " + i.toString() + " <font size=\"12\">- </font></u></font></b> ";
myCLabel = new ICLabel();
myCLabel.date.htmlText = GlllStringUtil.checkDigits(i.toString());
myCLabel.date.background = false;
myCLabel.date.textColor = "0x666666";
myCLabel.date.autoSize = TextFieldAutoSize.CENTER;
myCLabel.date.selectable = false;
myCLabel.date.mouseEnabled = true;
myCLabel.y = 0;
myCLabel.x = 25 * (i - 1);
myCLabel.name = i.toString();
myCLabel.data = thisday;
myCLabel.addEventListener(MouseEvent.MOUSE_OVER, myCLabel_mouse_over);
myCLabel.addEventListener(MouseEvent.MOUSE_OUT, myCLabel_mouse_out);
calendarHolder.addChild(myCLabel);
}
If I repeat this inside the statement I get a 1084 for using else if { var...
I can use else, but then if I start the next section with if/else and while it does what I need - the appearance is overriden by this last if/else.
I am trying to do this because there is only one statment for the appearance of future dates, which means that if there is a future event - it's not highlighted.
How can I repeat it inside using else if { var, without it returning 1084?
(Any assistance would be greatly appreciated as I have very little knowledge of AS3.)
--
Update:
Thank you so much for your reply.
The file is a .as and it's quite long so what I've done is upload it here as a .txt file. There are also 2 small gif images to try and demonstrate what I'm trying to acheive. (You'll notice (in the image) the tool tip appears over a highlighted date, but otherwise Future Dates aren't highlighted therefore you can't actually tell if there is an event unless you mouse over a date.)
I hope that is okay.
I did check to make sure that I didn't miss the closing brace before I posted but I think the error is beyond my understanding.