Category: snippets

  • Helpful snippet for me at the moment

    Here’s a handy little code snippet. Need to append the placement of a number? Use this! private function getNth (num:Number):String { var qn:int = ((num%100) / 10); var rn:int = num % 10; var suffix:String = “th”; if (qn != 1) { switch (rn) { case 1: suffix = “st”; break; case 2: suffix = […]

  • setting properties at runtime from xml or css

    Mainly this is just a post to remind myself in later times about this code snippet but basically this will work with any class with accessible variables. Take an xml node such as You can use this snippet to parse through those attributes to set all of your variables for you assuming they exist in […]