Thursday, July 16, 2009

Flex DataGrid CornerRadius

Stating what might seem the bleeding obvious here to the experienced Flex user, but I just came across the fact that the cornerRadius property doesn't work in Flex.

All I could find was this unhelpful bug tracking item which claimed it was fixed.

If you still want some curves on your DataGrid, throw it in a canvas and all your bendy dreams will come true.

Tuesday, July 14, 2009

Loading a Flex SWF into a Flash SWF and Passing Parameters

What sounded like it should have been a simple task was proving to be incredibly problematic. With the same virtual engine I should have just been able to access the properties of the flex swf with a dot property/function call. But to no avail.

It was only after reading iamdeepa on Flex's post on the Flex SystemManager and understood that I was trying to access properties of the SWF when it had just loaded (ie. Still in the SystemManger loading frame). So listen for an "applicationComplete" event, before accessing your loaded swf.

[code]
private var mClip:MovieClip;

function startLoad () :void
{
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest ("Flex.swf");
loader.contentLoaderInfo.addEventListener (Event.COMPLETE, onCompleteHandler);
}

function onCompleteHandler (vLoadEvent:Event) :void
{
mClip = vLoadEvent.currentTarget.content;
mClip.addEventListener("applicationComplete", onFlexSwfLoaded);
}

function onFlexSwfLoaded (vEvent:Event) :void
{
mClip.accessInternalPublicProperty = true; // or something
}

startLoad ();
[/code]

Wednesday, July 08, 2009

Beatherder 2009


Just got back from Beat-Herder 2009. Was utterly brilliant. Played a really fun set on the Friday night that seemed to go down pretty well despite my partner in crime turning up a tad on the late side.

Thoroughly brilliant festival!!!!

Wednesday, July 01, 2009

ID3 v2.3 MP3 Embedded Images

I've just spent the better part of two days trying to figure out how to extract an image embedded in an mp3 is AS3. Given a starting point of I didn't even know they embedded images in mp3's (doesn't sound like a very good idea to me) - and then having looked at the ID3 v2.3 site (now on 2.4) I felt none the wiser.

It's the most seriously unhelpful documentation on an overly complicated file format. With a few added extras, just to make you chuckle, like an image format of "$11 A bright coloured fish".

Salvation from the horror of trying to make sense all this came in the form of Ben Stucki and his Metaphile AS3 Library.