Blogs

Image transcoder options in Flex SDK 4

Since version 4 of Flex SDK, when embedding PNG assets using the [Embed] tag, you can specify the compression level of your assets.

It should look like:

[Embed(source="asset.png", compression="true", smoothing="false", quality="80")] public static var pngAsset: Class;

Using this technique can drastically reduce the resulting SWF file size.

Convert multiple images

The question was, how do I convert many graphic files (TGA) at once to other format (PNG, JPEG etc.)?

After spending some time on the net, I've found a simple solution. For batch convertion, there's a nice utility, ImageMagick Convert. It's often used on web sites (Wrenchgames is not an exclusion).

another one in progress

Another port of a casual game has reached Alpha stage. Come again soon & play!

Another useful piece (ActionScript3): dump the contents of a container

Here's a nice as3 code snippet that comes in handy. It dumps the content of an object, and all of it's elements recursively. This is a very common tasks, the code lets you avoid headaches.

public function dump(object: Object, indent: String=''): void {
   indent+='\t'
   for (var s: String in object) {
      trace(indent+s, object[s])
      dump(object[s], indent)
   }
}

Let's imagine we have a complex structure of this kind:

   var object: Object={
      item1: { subitem1: 'something1', subitem2: 'something2' },
      item2: { subitem1: 'something1', subitem2: 'more data', subitem3: 'something3', extra: {subitem1: 'extra data 1', subitem2: 'extra data 2'} },
      item3: { subitem1: 'something1', subitem2: 'something2', subitem3: 'something3' }
   }      

When you execute the code above, passing the object as argument, you get a neat list in your console window:

   item3 [object Object]
      subitem3 something3
      subitem2 something2
      subitem1 something1
   item2 [object Object]
      subitem3 something3

PeaceCraft is coming soon

Another game has been ported by us to Flash. Check again soon to see this great game by NevoSoft!

Syndicate content