Cairngorm Getting Started Part Two : Setting up the Environment

For an overview of Cairngorm check out part one.

OK – before we can start we need to set up the environment.  First things first go and get Cairngorm from here.  For now just download the binary, but further down the line you may want to download the source to have a look at the guts of the code.  Unzip the folder to somewhere that you can easily find.  I have a central folder called codeLibrary for all central code, but to be honest you can keep it on the desktop if you want.

Now fire up Flex Builder and create a new project.

Creating a new flex project

Don’t click on finish click on next, the next screen asks where you want to compile the application to (default is fine, normally bin-debug), click next again.  Now we need to map in the Cairngorm library in, this is the .swc file you got in the download.

Click on the library tab, then the Add SWC button.

Browse to the folder where you unzipped the file and select the Cairngorm.swc.

Click OK

Cairngorm folder sturcture

then finish.

Now we have access to the Cairngorm library.

NOTE : If tyou do get overexcited and click on finish and create the project before adding the Cairngorm.swf simply right click on the project, select preferences then Flex Build Pah.  This will then show you a similar dialog to the one I described above and you can map in the SWC there.

Final thing to do is to set up the folders for the Cairngorm structure.  This is not compulsory, but you’ll find it a lot easier if you have a folder structure like this.

Right click and select new – > folder.  I won’t go through it step by step, but here’s the recommended structue.
Cairngorm Folder Structure

EDIT : I realised that’s not too clear.  The folder structure is : -

com

____>worthyashes

————->simpleCairngorm

—————————>business

—————————>commands

—————————>control

—————————>events

—————————>model

—————————>responder

—————————>view

—————————>vo

The com/worthyashes bit is just a standard namespace so if someone uses my classes they shouldn’t conflict with other classes (worthyashes is my normal username).

simpleCairngorm – this folder is really to hold all the code that specifically relates to this Cairngorm app.  This means that if you have a number of different bits of your app all using Cairngorm in theory you can pull an individual bit out and use it on other project, for example a user management system.

The sub folders of the simpleCairngorm folder are the actual suggested folder structure for Cairngorm.

Sorry it wasn’t clear from the piccy.

END OF EDIT.

OK – thats done.  Next – finally time to get our hands dirty with some code! (Well nearly.…..)

Tags »

Author:admin
Date: Thursday, 19. June 2008 22:26
Trackback: Trackback-URL Category: Cairngorm, Flex, Flex Builder, Frameworks, Tutorials

Feed for the post RSS 2.0 Comment this post

Submit comment