Created
October 25, 2010 12:31
-
-
Save jankeesvw/644872 to your computer and use it in GitHub Desktop.
CalendarIcon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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