I’ve always been fascinated by networks, and everything that can be modeled as a graph. In some spare time one I’ve tried to model a simple graph structure in actionscript 3 that can be implemented to render some nice example. I want to extend it by adding some graph algorhythm like Breadth-first search, Depth-first seach, Dijkstra and others, just to keep mind busy in the summer, since in 3 days from now i’ll be officially unemployed.
So the first example consists in a bunch of nodes connected.. uhhu! Nodes can be activated, and each time this happens to a node, there is a chance that he activates his neighbours.
If you want to see the code, there are two steps: I’ve stored the code that models the network (the Graph class and the INode interface) in a simple framework of mine that you can checkout from here; then you can download the project as a zip file from this link)
As a references, you should see Levitated examples on networks, starting by this one or by this one.
Just a quick reminder on how to shut up the master volume on a flash project. I like a smooth tween to the silence, so I’m using the TweenLite libraries.
The trick here is to tween the volume property of a throw-away SoundTransform object, and on each step of the Tween apply that object as the SoundMixer.soundTransform Object, with an helper function. Note that I’m not going to write the function inside the TweenLite’s partameter list, as it is gross and dirty.
Tweening the volume back to 1 is so easy that I’m not writing it, to not offend anyone.
Another post on tools I really appreciate while working; Lita is another SQLite administrator tool, made by David Deraedt. It really stands among other admin tools.
Every now and then, while working on a AIR application, i feel the need to save or restore some config info, like the last window position, or the last opened files.
Instead of embedding this login in every app, I thought about a PreferenceManager class that stores and restores values.
How it should behave:
It must save data on a file.
It must save data on an open and editable format, so if something goes wrong..
It should be a static class, so i can access it in every other class of my application, whitout the need to have the reference to the instantiated object.
It should be really simple to use. And should not require any setup.
It suggest to use the JQuery Flash Plugin to embed the swf movie, but works perfectly also with the flexbuilder default html template.
Also, I suggest to include jQuery api from a Content Delivery Network, to provide faster access worldwide, like the Google AJAX api library or the Yahoo one.