Category: actionscript

  • 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 = […]

  • code reviewing and tons of debugging info!

    In the last month or so I’ve been tasked with reviewing a project for performance profiling and just code cleanup in general. It’s been quite a task as I wasn’t familiar with a single part of the code so finding tools to aid in this is uber helpful. With that in mind, here are a […]

  • Uploading multiple images/data to server!

    Oh man what a life saver this was! Super easy to implement and works awesomely so far! Multipart form data in as3 [Class version 1.2] Implementing is as easy as this: jpgEncoder = new JPGEncoder( 100 ) var photo:ByteArray = jpgEncoder.encode( this.getBitmapData( photoBitmap) ); var thumbnail:ByteArray = jpgEncoder.encode( this.getBitmapData(thumbnailBitmap) ); var ml:MultipartURLLoader = new MultipartURLLoader(); […]

  • 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 […]

  • Dynamic class property retrieval

    I’m taking a break from the pattern tutorials for the moment to write the as3 facebook connect integration library I’ve been meaning to write. With that said, here’s a little method I didn’t realize was around to pull properties from classes. Normally the for..in method you can pull properties available within an object, but this […]

  • Singleton Pattern introduction

    Staying on the course of my tutorial kick I’m now moving to the Singleton pattern. Understanding this pattern will help later in understanding patterns such as the Factory Pattern which I will be discussing later. Another pattern, or rather anti-pattern according to some, is called the Singleton Pattern. The Singleton pattern, as the name implies, […]

  • MVC (Model-View-Controller) introduction simplified

    It recently came to my attention that while working alone I have lost a bit of the ability to explain programming patterns. It’s not that I’ve forgotten about them, as I use variations of them in everyday work, but I’ve just lost touch with the ability to easily explain the workings of them. So what […]

  • See the code Flex generates for you

    A fascinating way of seeing all the code that the mxmlc compiler generates from your flex apps is to set a compiler flag for your project. -keep This takes all the generated code from your mxml files and places it in a “generated” folder in your src folder. This is great because it gives you […]

  • FireBugLogger class update

    So a while ago I wrote a class that I called FireBugLogger that uses the console.debug as well as the rest of the FireBug method calls. Today I came across a great way to help the other developers that may be implementing your flash on the html side. Though you’ll have to call the debug […]

  • crossdomain gateway or “How can I get that data!”

    A lot of sites today are very open with their APIs allowing users from other sites to retrieve their data, but sometimes you’ll come across websites that may not have that same open access. When their sites limit the access that other sites can retrieve data from via the crossdomain file it’s frustrating to say […]