Creating Collapsible Pane

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

This is not a walkthrough tutorial, so you can download the source right now and explore it yourself. Below I explain the general concept of this component, which you might find usefull to understand the structure of.

Creating Collapsible Pane is rather simple.
First of all you have to understand from what parts it consists of. Generally it consists of identical windows and each of this windows consist of -

As for functionality this window has to resize itself to match size of added content, basic open/close states which are implemented by simply setting visibility of a content holder to true or false. And ,of course, such methods as setPaneLabel() or setPaneContent().

So, the actual CollapsiblePane class would just create thouse windows inside itself, handle their positioning, and have public methods to manipulate them. First you start by creating a new instance of a CollapsiblePane on a stage and then filling it’s data provider with an array of objects that in turn consists of a label and data ( {label:”Test1″, data: new Button} , for example). You can also directly add panes to it. Read more

Renju, The Game

RenjuI have been playing this game for a while and thought that it whould be interesting to create my own flash version. For those who don’t know this game, a bit about it - Renju or Lianzhu is the professional variant of Gomoku, a board game originated from Japan in Heian Period. It was named Renju by Japanese journalist Ruikou Kuroiwa in December 6, 1899 in a Japanese newspaper Yorozu chouhou. Lianzhu is a Chinese translation of Renju. It is played with black and white stones on a 15×15 intersection board.

Two players, Black and White, alternately place two stones of their own colour, black and white respectively, on empty intersections of a board, except that Black (the first player) places one stone only for the first move. The one who gets five or more stones in a row (horizontally, vertically or diagonally) first wins the game.

So try it here. You can also download the source. Please note that this game is build on PureMVC version 1.7, and it won’t work under a new version 2.0.1 that has just been released. Just in case, I’ve included older version in source.

Hope you like it, and have fun.

Post Update: March 17, 2008

Implemented difficulty level functionality, some bug fixes and updated code to PureMVC version 2.0.1 . Download source.
For any thoughts about improving this game or bugs, leave comments.