I’ve just updated my blog.
Went from b2evolution to wordpress
Had some problem getting add media bar in admin to work and there was no reel good way to swap, hope I havn’t missed some posts and links. If you notice anything please tell me.
When I get some time I will update so it looks a little better.
If anyone has any good plugin pointers please let me know, cool features or embeding flash, galleries e.g.
Life blog, wordpress

Wrote for a couple of months ago that I went freelancing, since then I’ve hold a couple of lectures, writing courses and doing some small work.
Lately I’ve joined up with a couple of friends and we started “Hello There”. More info of what we do, who we are and so on will be published in the future. Right now I’m just glad to say that one of our main focus is games.
This as you might have noticed has slowed down my blogging but I will try to keep up when I find interesting stuff.
Love Hello There!
Life hello there, work
A good thing when developing is to be able to generate code documentation for better overview and when sharing code for e.g. Open source or internal at your workplace.
With Flex you get the asdoc compiler, and by using Flex + ANT it’s simple to create some docs.
Make sure that you have ANT enabled and working.
1.) Open Flex Builder
2.) Help -> Software Updates -> Find and Install…
3.) Select: Search for new features to install
4.) Mark: “The Eclipse Project Updates” and click Finish. (url if needed)
5.) Expand the tree “Eclipse 3.3.2″ or newer.
6.) Find: “Eclipse Java Development Tools”, Mark and install.
Now you can create a new Actionscript or Flex project. Place the ANT XML file in project root file and run the “create_asdoc”, a new folder “docs” will be created and there is where you find your documentation.
Download ANT Script here.
For Windows users change the paths (C:/Program Files/Adobe/Flex Builder 3/sdks/3.0.0/bin/asdoc.exe)
Good links
ASDoc Tool
Example on how to document code
Flex actionscript, asdoc, documentation
This post is used for my course with the class “Webbh07″ at KY-Lindholmen/Gothenburg/Sweden. Welcome to their wonderful website.
I will post assignments, project files and the presentation material public for the class and for anyone that’s interested.
Read more…
Life education, speaker
When developing Flash Applications I like to use the Cairngorm micro-architecture as I do in Flex. Without all the nice Flex Framework classes it takes a little more work. Iteration Two did a Cairngorm Flash 0.95 package but that seems to have fallen of the web.
So I took the Flex Open-Source 2.1 Cairngorm classes and removed everything until it started to work.
You can download the Cairngorm to Flash code here.
To think about is that;
- Delegates needs to handle the creation and sending of external services
- Bindable does not exist so instead dispatch when data is updated
There are probably a lot of more things here.
Flash cairngorm, Flash
I using ANT + SVN tasks a lot for compiling the startup for projects. Took me a while to setup it to work on MAC but the solutions was pretty easy. This will work on a PC as well.
What you first need.
You need the ANT plug-in and you can get that from Eclipse JDT Development
1.) Open Flex Builder
2.) Help -> Software Updates -> Find and Install…
3.) Select: Search for new features to install
4.) Mark: “The Eclipse Project Updates” and click Finish. (url if needed)
5.) Expand the tree “Eclipse 3.3.2″ or newer.
6.) Find: “Eclipse Java Development Tools”, Mark and install.
This is what you do.
1.) You will need SVN Ant, and for some actions it help to add the jakarta regexp, jakarta oro, commons, commons-net packages. To make it simple, grab this zip file.
2.) Open “Flex folder”/plugins/ and create a folder “svnant” and place all the files.
3.) Open Flex -> Preferences -> Ant -> Runtime
4.) Select “And Home Entries” and then “Add External JARs…”
5.) Select all the JAR files you copied to /Flex Builder 3/plugins/svnant/
6.) Create a new project in Flex. Place the build.xml file in the project root.
7.) Right click on the build.xml and select Open With -> Ant Editor.
8.) Set your properties in the top and then right click on getSVNCode in the “Outline window”, Run As -> Ant Build.
TIP.
ANT scripts can grab properties files and run ANT tasks from other ANT files. So you could setup a structure how to read scripts and unique project data to make it more generic.
Documentation to read.
SVN: http://subclipse.tigris.org/svnant/svn.html
ANT: http://ant.apache.org/manual/tasksoverview.html
Flex ant, Flex, svn
Having problem when developing Flex sites with the memory, is it to slow? No probs, lets kick it up a notch.
1.) Go into Flex Package Content, CTRL+”Mouse Click” on the Flex Builder 3 file and select “Show Package Content”

2.) Go into Contents -> MacOS and open “FlexBuilder.ini”.
3.) Change memory to what you want.
-Xms = Minimum Memory
-Xmx = Maximum Memory

So change the Xmx to a higher value, e.g.
-Xmx1024m
Ant Script
This doesn’t work if memory isn’t enought for running ant scripts. If this is your problem, try this.
1.) Open Flex Builder
2.) Window -> Preferences -> Java -> Installed JREs
3.) Mark the JVM package that you are using when running the Ant script and click “Edit”.
4.) Add memory properties to the “Default VM Arguments”, e.g. “-Xmx1024m”.

Flex Flex, memory
What’s up with Google Analytic. Wonderful service for HTML available content but what about offline content?
The javascript API provided by Google blocks sends when not all values are fulfilled.
So how to do this in an AIR application, or a Widget???
After a lot of Google Searching online and Help Sections there is no answer. What I got to so far is that it’s the Cookie handling that mess up the sending of tracker code.
Using a HTMLLoader in AIR I’m trying to get it to send my tracker data but with no success. Everything goes fine and with the startup of the _gat (JavaScript API Class), all values even cookie looks correct.
The problem gets when trying to run the _trackPageview(”); it starts to loose data, mainly the cookie and then the API stops to work.
A bug in the API or some security problem? Anyone out there has any suggestion please advice.
Life analytic, api, google
Found an Example of Chain Events at http://www.cairngormdocs.org/bjorn_schultheiss/eventChaining/EventChainExample.html (right click and check source).
So I put the code to an default Cairngorm Structure that you can download here. Just make sure that you have the Cairngorm.swc package in libs.
This is what files that exist.

Important to think of:
1.) All events extends ChainEvent
public class TestAEvent extends ChainEvent
2.) All commands extends SequenceCommand
public class TestACommand extends SequenceCommand implements ICommand
3.) All commands take the nextEvent and execute when done.
override public function execute(event:CairngormEvent):void
{
nextEvent = ChainEvent(event).nextChainedEvent;
// Do Command Action
this.executeNextCommand();
}
That’s is…
Here is an example of executing a couple of commands.
var beginChain : ChainEvent = EventChainFactory.chainEvents([
new UpdateViewEvent(ModelData.VIEW_LOADING),
new CheckSoftwareVersionEvent(),
new GetLocalSettingsEvent(),
new GlobalApplicationEvent(),
new GetFeedListEvent(),
new UpdatePostStatusEvent(),
new UpdateViewEvent(ModelData.VIEW_POSTS)
]);
cgDispatcher.dispatchEvent( beginChain );
————–
UPDATE: 2008-02-21
I’ve added a couple of changes for the demo files.
E.g. when creating an event it’s possible to send custom data
new TestAEvent( “CustomValue” )
and it’s just as easy to extract it in the command
var customEventValue:* = event.data;
You can add any data to the next event in the chain from the command, maybe to pass forward the data or something new. Here is an example.
nextEvent.data = customEventValue;
You can as well runtime change the next event from a command, here is an example.
nextEvent = new TestCEvent();
Flex cairngorm, chain, event
Tried to look at AMFPHP and by doing that I need to learn some basics in PHP. So with that I did a little image header swap for my blog. Did 4 small images.
The PHP looks like this.
// Change this to the total number of images in the folder
$total = "4";
// Change to the type of files to use eg. .jpg or .gif
$file_type = ".jpg";
// Change to the location of the folder containing the images
$image_folder = "images";
// You do not need to edit below this line
$start = "1";
$random = mt_rand($start, $total);
$image_name = $random . $file_type;
echo "<div id=\"header\" style=\"background-image: URL($image_folder/header-bg$image_name);background-repeat:no-repeat\">";
Life blog, header, image, php, random