After seeing the Silverlight Chess sample I immediately started work on a flash version. It needs a lot of optimizing, not a single variable type was set, so it’s not a very fair fight. Anyway … flash is about 10x faster than the ie7 js engine on my machine. But still a lot slower than silverlight.
Archive for the ‘Flash’ Category
Silverlight vs Flash Chess
2009-03-16full-screen mode in Actionscript 2
2008-02-19How to use full-screen mode in Actionscript 2:
_root.btn_mc.onRelease = function(){ if(Stage["displayState"] == "normal"){ Stage["displayState"] = "fullScreen"; }else{ Stage["displayState"] = "normal"; } } var listener:Object = {}; listener.onFullScreen = function(isFullscreen:Boolean){ if(isFullscreen){ trace("entered full-screen mode"); }else{ trace("exited full-screen mode"); } } Stage.addListener(listener);
forceSmoothing
2008-02-15Rotating and scaling pictures in flash is easy. Just use _rotation, _xscale and _yscale. Except when you publish an swf for Flash Player 8 or newer. Every image you rotate or scale will become jagged. Very anoying. To remedy this you can either publish for Flash 7 or use a complicated loadBitmapSmoothed function that uses BitmapData.
When Flash Player 8.5 came out it introduced the forceSmoothing property. This property is also available in as2. Now all we need to do is set it to true when we load images. Don’t forget that this will have no effect in Flash players older than version 8.5!
It works quite well. In the example below you can clearly see the left picture is more jagged than the right one.
pong0.5k, a game in 510bytes
2008-01-30Mr.doob created a 1k pong game in as3. Which made my fingers itch to do better. So here it is, in as2, less than half the filesize and the same functionality.
FileZilla decrypt
2007-11-04Every now and then I get someone asking me for an ftp password. Mine have always been stored in FileZilla. I don’t know them by heart. There is no problem with this except that FileZilla encrypts them. Thank God decrypting FileZilla 2 passwords is easy. Here is some as2 code to accomplish it:
Papervision3D Component
2007-07-02If you ever need to use 3D in flash you can now use the Papervision3D Component. Thank you John Grden!
And Pierre Lepers created an event model for Papervision. Excellent work!
BlogReader in AsWing
2007-05-11The AsWing Blogreader was almost as easy to write as the Flex 2 BlogReader it mimics.
Right-click to view source.
Trace Output on Linux with Flash Player 9
2007-05-06Tracing on linux is hard. The official docs are wrong and multiple blogs contradict each other.
Flash player 9 for linux
2007-01-17Flash Player 9 For Linux (x86) has gone gold.
SOS Flash Log Tail
2006-12-17At work I use SOS in conjunction with the As2lib Logging API to log messages from flash. This works very well, except for the odd legacy program that uses the trace command for logging. This is where the flash debug player comes in handy.