Plist files are more and more ubiquitous. Apple uses them for its configuration files and we use them to describe exercise content. They aren’t very pleasant to read for humans, but that doesn’t mean computers dislike reading them. So I wrote a little javascript to parse a plist file to an object. Hope you like it.
Read the rest of this entry »Silver Explorer
2008-02-27As most of my friends know, I’m partially colorblind. Most webdevelopers have no idea what their site looks like for someone like me. Thanks to the power of Adobe Air I’m now capable of letting you experience it firsthand.
Silver Explorer is a browser that lets you surf the net in grayscale.
full-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.
Read the rest of this entry »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.
Read the rest of this entry »AIR afterhours
2008-01-18I’ve been to a great afterhours session about AIR with Peter Elst. He’s writing a book on the subject so obviously there was lots he had to teach. He covered the windowing, file, dragdrop, sqlite and upgrade apis. This was a bring-your-own-laptop session so all the people present were experimenting with the code. We found a few oddities that you usually learn the hard way.
FileFilter behaves differently on mac and windows. On windows the extension parameter must start with an asterisk "*.html", on mac both "*.html" and ".html" seem to work.
Creating and manipulating NativeWindows works great, but adding flex components to the stage of a new NativeWindow doesn’t seem to work. Daniel Dura had a workaround for this, but that doesn’t seem to work anymore.
He gifted a few books at the end. ActionScript 3.0 Design Patterns is now mine. Thanks Peter!
Update: Peter has remembered how to use mx.core.Window as a a native window.
Vista speedup part 2
2007-11-15Flash on the Beach – day 3 – Adobe town hall meeting
2007-11-07- New ways of working with video coming soon (before CS4).
- Cross-domain cache might not come for anything but Adobe stuff for security and privacy.
- Nothing is said about Flash on the iPhone.
- Adobe is listening to the community. Just send them lots of mail when you want something done. They really care.
- They are working on features to make Papervision faster, But they will not replace it by something else.
- Support for Chinese text will improve.
Flash on the Beach – day 2
2007-11-07Done
- Wow, Mario Klingemann’s presentation was great.
- Tink explained how to customize the flex preloader, use styles and skins and create your own skinnable and styleable components. He’s going to put his slides and code on his blog by monday. I highly recommend giving it a look.
- Robert Hodgin showed amazing animations in processing. The entire room went silent when he showed his work on magnetosphere.
- Disco dancing.
- 5 am … sleep.
Food and drinks
- Eggs and toast.
- Starbucks coffee.
- Pizza!
Flash on the Beach – day 1
2007-11-06Done
- Barely slept
- Registration. Got a goodybag containing flash on the beach slippers, stickers, a towel and a book.
- Intro.
- Next version of flash gets a cross-domain component cache, typed arrays, encrypted video streams, much better text flow, 64 bit support, multiple processor support, full screen gpu support, … Also see Aral’s post on this.
- Flex gets a performance profiler and renaming a methods will change all calls to it. Refactoring is finally here.
- Sneak preview of Flash CS4. Animation without keyframes, bezier paths for motion tweens, reverse kinematics, …
- Particle effects in as3.
- Pirates of accessability. Still no seamless tabbing in Firefox 3. Inspect32 gives us the same data as screen readers can get from flash.
- Joshua Davis was awesome.
- Casino time. Lost 5 pounds on the roulette.
Food and drinks
- full english breakfast with eggs, bacon and mushrooms
- funky tuna bagel
- loads of fried stuff at the casino