Archive for the ‘Flex’ Category

Navigatable ArrayCollection for Flex

Tuesday, March 18th, 2008

I’ve written a NavigatableList class to provide the already handy ArrayCollection class with a simple cursor-like navigation option. You can call list.navigateTo() and provide for instance list.next or list.previous. You also specify the class to which items should belong and you can search for an item with list.findItem(property, value). And finally, you can clone it with list.clone().

Download it here

EDIT: the clone() method didn’t work correctly for some reason. I’ve removed it for now.
EDIT: added an equals() method which compares this list to another list. You  must specify the  name of a unique property which can be used to check if two items are the same.

Flexotic

Thursday, July 12th, 2007

Check out the new website started by Rick Companje: www.flexotic.nl

It contains thoughts, experiments, tutorials, components and other stuff, all concerning Flex. Keep an eye out for interesting stuff on this website.

L-systems in Flex

Monday, July 9th, 2007

I’ve made a small application in Flex to draw l-systems with.
The previous post explains what l-systems are exactly, but here are the rules again in short:

L-systems is a grammar describing the growth of plant-like structures. It is made up of simple drawing commands and rules how these change during growth. For example, you start out with the command ‘F’ meaning draw one unit. You add a rule that says ‘change F to F+F-F’ where ‘+’ and ‘-’ mean turn left and right, respectively, with a predefined angle. Then, as it grows, the sequence of commands grows longer and more complex, as every time each ‘F’ is replaced by ‘F+F-F’ until you end up with a long sequence of simple commands that make up a complex shape. Add branching with the ‘[’ (start branch) and ‘]’ (end branch) characters and you can quickly create nice plant structures.

Try out the application here. It’s a small first version with some limitations, such as a maximum amount of drawing commands to prevent slow processing times, the possibility to define only one rule, and the fact that it always starts out with ‘F’. You can define your own rule of how ‘F’ changes (using F, +, -, [ and ]), you can set the angle of rotation and the amount of iterations to define the complexity of the resulting shape. If responses are too slow, you can turn off ‘update realtime’ and hit the ‘go’ button to calculate your l-system.

lsys_flex_01.gif lsys_flex_02.gif lsys_flex_03.gif