If-else trees have some of the best performance of any conditional code, including if-else ladders, the ternary (? :) operator, and the switch statement. But how do they stack up against the O(1) lookups that Object and Dictionary offer us AS3 programmers? Today’s article finds out!
Archive for March, 2013
Surprisingly, some interesting things have been happening with conditionals like if-else in AS3. First, a brand new AS3 compiler—ASC 2.0—has been released with the promise that it’ll generate more efficient bytecode. Second, some readers have pointed out the existence of a new (to me) technique: the “if-else tree”. Today’s article takes a look at just what that is and tests it against the classic options: if-else, the ternary (? :) operator, and the switch statement. Which will be fastest?
Having covered JPEG-XR images recently, one thing has struck me as a little odd: there aren’t really any good cross-platform viewers available to look at them. Yes, it’s a bit of an obscure format, but shouldn’t there be something available? Well, I decided to make a simple Flash app to load a JPEG-XR image from a URL or a browse button and display it. Along the way I added support for PNG, JPEG, GIF, AVM1 SWF, and AVM2 SWF. Today’s article has the source code and the viewer itself. Added support for panning the image
Now that we’ve determined the best PNG compressors to create PNG images with, let’s delve into the world of JPEG compressors. As with PNG, we have multiple options to choose from in our Flash apps when we’re looking to encode images such as screenshots. Which is best? Today’s article delves into each compressor’s performance and file size efficiency.