Entries for month: July 2009

Operating System Detection in Flash Player

Flex / AIR , Flash 5 Comments »
Here is a great little script I found for detecting the OS. import flash.system.Capabilities; var flashPlayerVersion:String = Capabilities.version; var osArray:Array = flashPlayerVersion.split(' '); var osType:String = osArray[0]; //The operating system: WIN, MAC, LNX var versionArray:Array = osArray[1].split(',');//The player versions. 10,0,22,87 var majorVersion:Number = parseInt(versionArray[0]); var majorRevision:Number = parseInt(versionArray[1]); var minorVersion:Number = parseInt(versionArray[2]); var minorRevision:Number = parseInt(versionArray[3]);

Garbage Collection Woes in Flash

Flash 1 Comment »
I've been fighting GC in flash for the last two weeks. The standard answers (no timers, intervals, enterFrame listeners, strong references) do not apply. (And we also tried FP11, which theoretically gets rid of all of this for you anyway.) But I did run across a few nice event listener manger classes. Grant Skinner has his Janitor class (which I found attached to an online presentation). But even more impressive was Danny Miller's EventManager class (http://k2xl.com/wordpress/2008/07/02/as3-eventmanager-class-removealllisteners/) which is available on google code. Unfortunately, neither of these helped my situation; we were using a standard button component on the stage in a nested MC. If we didn't need it, we pitched it via removeChild() and nulled out the reference to it. Unfortunately, that was not sufficient, preventing the swf from unloading. So we are now building our own button class. grrrrr
Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds