Archive for March, 2010

Tues 6th Apr: iPhone Dev (part 1 of 2)

Tuesday, March 30th, 2010

‘The name’s Bond. Paulo Bond.’

Bond stood aboard the Orient Express. The train came around sixteen coaches long, and Bond shook the hand of the man who had just stepped onto it. His beige moustache and well-worn Macintosh gave him away as an English agent. Bond found himself staring into cold eyes that gave nothing away.

‘I’m Captain Nash, old man. M sent me personally. What’s this business about?’

As the train began to pull out of Belgrade, Bond slipped a sleek device out of his inside pocket. ‘This is an iPhone, Nash, the latest thing in mobile communications. Q tells me it can be programmed with both AS3 and Objective-C. I’m to show you the basics of the Objective-C method, and compare and contrast it with the AS3 method.’

Nash gazed coolly out at the city sliding by. ‘I have a contact to meet in Venice, old man. Can this wait?’

Bond slipped a gold-banded cigarette out of his silver case and lit it. ‘Of course, Nash. We’ll be in England in five days. I have a safehouse away from London we can use. Meet me at 7pm on Tuesday 6th April at The Werks in Hove and we’ll go through this together. Oh, incidentally this will be just the first of two such briefings. Make it on the 6th and a week later I can expand on it. Can’t tell you quite how yet – you never know who’s listening – but if you turn up on the 6th perhaps you’ll find out.’

‘Paulo, can’t you come back to bed?’ called a female voice from the cabin behind Bond. It might have been Russian, or South African. It was hard to tell. Bond smiled enigmatically.

‘If you’ll excuse me, Nash.’

How we stream our meetings

Sunday, March 28th, 2010

Branden Hall at FlashBrighton

I’ve just written a post for Influxis explaining how we used their TVStation app, to broadcast Branden Hall’s remote Hype presentation last week.

Streaming a remote presentation with TVStation

Tues 30th Mar: Cancelled for Five Pound App

Friday, March 26th, 2010

Scene 1. The chip shop. Bianca Lee-Delisle is behind the counter serving someone. Ricky Willis storms in brandishing a flyer.

BLD: ‘Ee-aye luv, one eighty change. Fanks bye.’

RW: (waves flyer angrily) ‘Bianca! Wha’s this? Five Pound App on March 30th? Dat’s Tuesday init, we do FlashBrighton on Tuesday, but this says that FlashBrighton has been cancelled next week for Five Pound App!’

BLD: ‘Ricky, I… Look, I just need a change, that’s all. I just like Five Pound App init. Don’t mean I like FlashBrighton any da less, do it?’

RW: (let’s flyer drop) ‘Bianca, you know I don’t mind if you got aht wif ya mates and dat. I just, d’you know wot I mean, I cancelled a shift at da garage and effrefing.’

BLD: ‘Ricky, why don’t you come along? Be fun wud’nit?’

RW: ‘Ah I dunno, maybe I’ll just get that shift back at the garage. But you ave a good time, yeah?’

BLD: ‘Aw, fanks Ricky. but we’ll do FlashBrighton next Tuesday again, yeah?’

Scene 2. The Queen Vic. A pub band get uppity when everyone goes to the bar during a song they’ve written…

Tues 23rd Mar: Hype in Wonderland

Tuesday, March 16th, 2010

Branden Alice came across a clearing in which a tea party was taking place. A Mad Hatter and the March Hare were perched at the end of a long table. In-between them sat a sleeping Dormouse, whom they used as a cushion, as they talked to each other over his head. The table was covered in long AS3 classes, boring Flex apps, and heavy technical manuals. Alice sat down at the far end.

‘Have some fun,’ said the Hare invitingly.

‘I don’t see any fun,’ Alice remarked, peering around the table.

There isn’t any fun, hasn’t been any since Adobe created AS3,’ said the Hare.

‘Would you like some Hype?’ said the Hatter, holding up an enormous teapot.

‘I should like to know what it is first,’ demanded Alice.

It’s a framework that simplifies the AS3 API, letting you play with Flash whilst writing solid, clean code,’ said the Hatter.

‘Boring AS3 goes into this pot, and fun Hype comes out, because learning should be fun,’ said the Hare. The Hatter poured Alice a cup.

‘There’s nothing in here,’ said Alice indignantly.

‘It takes time to pour. According to my pocket watch, your cup of Hype will be ready on Tuesday 23rd March at 7pm at The Werks. Make sure you’re there to receive it.’

The Dormouse suddenly awoke. ‘I’ve got fur in my kettle and a film on my tea’ he spluttered.

‘You’ve got fur on your back and a film at the cinema,’ Alice corrected him. ‘But I wouldn’t bother seeing it, it’s not a patch on Edward Scissorhands.’

Tues 16th Mar: Introduction to ASDoc

Friday, March 12th, 2010

David de Worde strode into the press room of the Ankh-Morpork Times. ‘Goodmountain,’ he bellowed at the dwarf who controlled the digital press ‘I have a story to dictate.’ Goodmountain nodded, and sat down at the keyboard.

‘GRANT SKINNER RESCUES ASDOC – that’s the headline.  Adobe’s ASDoc has emerged from the Command-Line age through the bold actions of Flash Developer Grant Skinner. Adobe’s documentation tool “ASDoc” only runs from the command line, but Skinner “skinned” it by creating ASDocr“, a simpler graphical interface.’

Bamboozled by the unbridled enthusiasm with which de Worde was promoting this esoteric – if doubtless fascinating – topic, the dwarves on the subbing team subconsciously released their grip on their e-rats to listen in. The e-rats emitted a collective digitised squeak as, scenting freedom for the fourth time that morning, they yanked their tails from the sockets and swarmed through a hole into the server room. Goodmountain audibly sighed as the last of them disappeared. Equally mystified, sub-editor Sacharissa looked up from her ‘WEREWOLF IN MOLE STATION NURSERY DRAMA’ story, in which she was trying to spell an interviewee’s laugh, and asked ‘David, what in Discworld are you on about?’

‘It’s news to you, but I use ASDoc to generate docs for our Flash and Flex APIs. It’s great, but hard to use, and ASDocr really simplifies it. I want you all to come to The Werks next Tuesday at 7pm so I can show you why ASDoc is good, and ASDocr is great.

Goodmountain was on his knees, peering down the hole after the rats. ‘We’ll be there, just as long as we can get these dratted e-rats back,’ he said, scraping around inside with the shaft of his axe.

Searching hierarchical data (without recursion)

Wednesday, March 10th, 2010

Yesterday, I needed to tie in some native menu items in an AIR application, so after a bit of Googling, I came across the AIR docs, which had a description of how to do exactly what I wanted. However, there were 2 problems with the example they had. Firstly, it used a recursive function, which is slow. Secondly, the code didn’t actually work, which is really not helpful.

So, I had to write my own and thought I’d share it here. This kind of function is good for any hierarchical data; tree structures, menus, file systems etc. and wouldn’t take much to adapt. Here’s the code:

public static function findNativeMenuItemByLabel(menu:NativeMenu, label:String):NativeMenuItem
{
	// first create the vars and store the first item
	var currentMenu:NativeMenu = menu;
	var currentIndex:int = 0;
	var indices:Dictionary = new Dictionary(true);
	var menus:Array = [currentMenu];
	indices[currentMenu] = currentIndex;
 
	while (menus.length && currentIndex < currentMenu.numItems)
		{
			currentMenu = menus.pop();
			currentIndex = indices[currentMenu];
		}
	}
 
	return null;
}

This works by storing an item and an index for each item. It then checks the item against the search term (in this case label) and returns it if it has found the item we are looking for. If not it checks whether it has any children. If so, we store the item and its index (note that we increase it by 1 before we store it – this is so when we come back to the menu, we pick up the next item in the list, rather than the one we were last on) and move onto the submenu. If there are no children, we move through the list, checking each in turn, until we have checked them all. At this point, we pull out the item we stored before (the parent menu) and continue working through, until we have checked all the items.

Using this kind of ‘stack’ system is much faster than using recursion, uses less memory and, I think, a little easier to understand.

Hope this helps!

Owen

Notes and files from the Blender talk

Wednesday, March 3rd, 2010

Many thanks to Tim and Alison for the introduction to Blender last night.

Tim’s notes (including links to references and tutorials) are in a google doc and can be found here > http://bit.ly/b515Si. Also, there’s a whole bunch of excellent rigs that are free to download and use > http://bit.ly/bYM1qd < it’s a big .zip file, approx. 223 mb.

Alison’s ‘Resources’ and ’1st Keys and Buttons’ docs are available from > alisons_blender_docs.