Skip to content

Instantly share code, notes, and snippets.

@jankeesvw
Created October 25, 2010 12:31
Show Gist options
  • Save jankeesvw/644872 to your computer and use it in GitHub Desktop.
Save jankeesvw/644872 to your computer and use it in GitHub Desktop.
CalendarIcon
package nl.musis.view.components.menu.icons {
import fla.menu.icons.CalendarIconAsset;
import nl.musis.model.utils.DateUtils;
import nl.musis.view.components.text.styles.HeaderText;
import flash.display.BlendMode;
/**
* @author Jankees van Woezik | Base42.nl
*/
public class CalendarIcon extends CalendarIconAsset {
public function CalendarIcon() {
var date:Date = new Date();
var day:String = (date.dateUTC < 10) ? "0" + date.dateUTC : String(date.dateUTC);
var month:String = DateUtils.getThreeLetterMonth(date.getMonth() + 1);
var dayfield:HeaderText = new HeaderText(day);
dayfield.x = -dayfield.width / 2;
dayfield.y = -13;
addChild(dayfield);
var monthfield:HeaderText = new HeaderText(month.toUpperCase(), 12);
monthfield.blendMode = BlendMode.ERASE;
monthfield.x = -monthfield.width / 2;
monthfield.y = -30;
addChild(monthfield);
blendMode = BlendMode.LAYER;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment