Friday, March 5th, 2010
Had this little idea a while back, thought I would spend an hour tonight and bash it out.
I love the Trance Around The World radio show by Above and Beyond, downloading it for listening later is very annoying however and involves some fiddling with browser source and other things, so to make life easier I built this little tool. What it does is grab the HTML from the above and beyond page then parse it for the MP3 file, then it uses the FileReference class in flash to download it to your HD.
Anyways, enough jibber jabber. Source is enabled:
Please upgrade your Flash Player This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.
Hope you enjoy!
Tags: Actionscript, Audio, Download, Flash, Flex, MP3, Music, Source, Trance
Posted in Actionscript, Flex, MXML, Personal Projects, Programming | No Comments »
Monday, February 22nd, 2010
Thought I would share this little ditty. Been working in AIR recently and decided to make the window “chromeless” which means there are no controls so no resizing.
Thankfully however adobe provide the tools to allow for resizing the native window. So I produced this little mxml component to let you resize the window:

The coloured edges indicate where the application is draggable, including the white corner areas.
The component that lets you do this is pretty simple:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">
<fx:Script>
<![CDATA[
import flash.display.NativeWindowResize;
import flash.events.MouseEvent;
import mx.managers.CursorManager;
public static const RESIZE_AREA : int = 10;
protected function onRollOver(event:MouseEvent):void
{
}
protected function onRollOut(event:MouseEvent):void
{
}
protected function onMouseDown(event:MouseEvent):void
{
var grp : Group = event.target as Group;
var resizeFrom:String = "";
if (grp==topSide){ resizeFrom=NativeWindowResize.TOP; }
else if (grp==rightSide) { resizeFrom=NativeWindowResize.RIGHT; }
else if (grp==bottomSide) { resizeFrom=NativeWindowResize.BOTTOM; }
else if (grp==leftSide) { resizeFrom=NativeWindowResize.LEFT; }
else if (grp==topLeft) { resizeFrom=NativeWindowResize.TOP_LEFT; }
else if (grp==topRight) { resizeFrom=NativeWindowResize.TOP_RIGHT; }
else if (grp==bottomRight) { resizeFrom=NativeWindowResize.BOTTOM_RIGHT; }
else if (grp==bottomLeft) { resizeFrom=NativeWindowResize.BOTTOM_LEFT; }
else { return; }
stage.nativeWindow.startResize(resizeFrom);
}
]]>
</fx:Script>
<s:Group id="topSide" rollOver="onRollOver(event)" rollOut="onRollOut(event)" mouseDown="onMouseDown(event)"
x="0" y="0" width="{width}" height="{RESIZE_AREA}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0xFF0000" />
</s:fill>
</s:Rect>
</s:Group>
<s:Group id="rightSide" rollOver="onRollOver(event)" rollOut="onRollOut(event)" mouseDown="onMouseDown(event)"
x="{width-RESIZE_AREA}" y="0" width="{RESIZE_AREA}" height="{height}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0x00FF00" />
</s:fill>
</s:Rect>
</s:Group>
<s:Group id="bottomSide" rollOver="onRollOver(event)" rollOut="onRollOut(event)" mouseDown="onMouseDown(event)"
x="0" y="{height-RESIZE_AREA}" width="{width}" height="{RESIZE_AREA}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0x0000FF" />
</s:fill>
</s:Rect>
</s:Group>
<s:Group id="leftSide" rollOver="onRollOver(event)" rollOut="onRollOut(event)" mouseDown="onMouseDown(event)"
x="0" y="0" width="{RESIZE_AREA}" height="{height}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0x000000" />
</s:fill>
</s:Rect>
</s:Group>
<s:Group id="topLeft" rollOver="onRollOver(event)" rollOut="onRollOut(event)" mouseDown="onMouseDown(event)"
x="0" y="0" width="{RESIZE_AREA}" height="{RESIZE_AREA}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0xffffff" />
</s:fill>
</s:Rect>
</s:Group>
<s:Group id="topRight" rollOver="onRollOver(event)" rollOut="onRollOut(event)" mouseDown="onMouseDown(event)"
x="{width-RESIZE_AREA}" y="0" width="{RESIZE_AREA}" height="{RESIZE_AREA}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0xffffff" />
</s:fill>
</s:Rect>
</s:Group>
<s:Group id="bottomRight" rollOver="onRollOver(event)" rollOut="onRollOut(event)" mouseDown="onMouseDown(event)"
x="{width-RESIZE_AREA}" y="{height-RESIZE_AREA}" width="{RESIZE_AREA}" height="{RESIZE_AREA}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0xffffff" />
</s:fill>
</s:Rect>
</s:Group>
<s:Group id="bottomLeft" rollOver="onRollOver(event)" rollOut="onRollOut(event)" mouseDown="onMouseDown(event)"
x="0" y="{height-RESIZE_AREA}" width="{RESIZE_AREA}" height="{RESIZE_AREA}">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0xffffff" />
</s:fill>
</s:Rect>
</s:Group>
</s:Group>
To use it in your app just add the component into your existing view somewhere:
<?xml version="1.0" encoding="utf-8"?>
<s:SkinnableContainer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo">
<components:WindowResizer width="{width}" height="{height}" alpha="0" buttonMode="true" />
</s:SkinnableContainer>
Setting the alpha to zero will obviously hide the coloured areas at the side of the window.
Grab the mxml here: WindowResizer.mxml
Tags: AIR, Component, Flash, MXML, Projects, Resize, Source
Posted in MXML, Personal Projects, Programming | No Comments »
Tuesday, February 2nd, 2010

Thought id mention these videos as I have been watching them and really like the content. They are a series of video blog posts by one of the ‘celebrities’ of the Flash and Flex world, in which he talks about lots of stuff related to whats going on in the industry and the various frameworks he uses or recommends (or doesnt). He also has a few things to say about beer, which is a bonus!
Anyways theres three of them so far, and can be watched over on his blog:
1 vs Many, Mediator vs Presenter, 30 mins – JXLTV – Episode #1
Conferences, Why Frameworks, Cairngorm 3 – JXLTV – Episode #2
Apple’s iPad, HTML5 Video, Gaia Flash Framework – JXLTV – Episode #3
Tags: Beer, Blog, Flash, Flex, Framework, Video
Posted in Fun & Videos | No Comments »
Sunday, January 10th, 2010

I have immense respect for some of the flash developers out there and Quasimondo is one of them. He has just released a little particle related experiment.
Whenever I see these kind of things it inspires me to bash out my own little experiments.
I wont talk too much about it but check it out on this lab page: http://incubator.quasimondo.com/flash/galactose.php
Tags: Actionscript, Experiment, Flash, Lab, Particles, Programming
Posted in Actionscript | No Comments »