Thought for the Dazed

I've had to give up that Distance Learning course as I was having trouble seeing the teacher.

Flickr
www.flickr.com
RobMiles' items Go to RobMiles' photostream
Twitter
C# Yellow Book

Search entire site
Tuesday
Jan192010

Imagine Cup Software Design at the Captain’s Table

You might not know this, but I’m the Captain of the Microsoft Imagine Cup Software Development competition this year.

No. I don’t get a special hat. Or a uniform. I did ask though…

What I do is make sure that from a judging point of view everything lines up, competitors know what to do, how to enter, and how to make the best entries.  As part of this I’m taking part in a Live Meeting later this week where I’m going to go through the Software Development Challenge, how the competition works and what the judges are looking for. If you are preparing an entry for the competition (or thinking about taking part) it would be well worth you turning up. You can find out more here:

http://imaginecup.com/Competition/mycompetitionportal.aspx?competitionId=37

Monday
Jan182010

LaserQuest!! Pew Pew Pew

Dan from Seed Software organised a bit of shooting fun tonight. And so a bunch of us turned up at LaserQuest in Hull. Some of us were dressed in black, which I thought was a good idea, until I discovered just how much it makes your dandruff stand out when they turn up the UV light. And from the look of everyone’s teeth it looked like we now all lived on the far side of the uncanny valley. Of course, I took the camera, although I didn’t use the flash and had to set the sensitivity to a very silly value.

4286388744

I think you should know that I got shot several times while taking this picture.

4285652523

One of the few remaining pictures of “The Outfit”

4286386398

Into the fray

4285649917

Peter uses a laser to lay down the law

4285679973

Ha. Go Red Team. And I wasn’t the worst one there either…

Sunday
Jan172010

More Chumby Fun

Getty Centre

I hate it when programs lie to you. Just spent a chunk of time finding out how to reliably put images into Flash programs that run on my Chumby. Clue: It is not as simple as it probably should be.

You can find out what I have been doing in my Chumby blog.

Sunday
Jan172010

Adding Images to Flash Programs using FlashDevelop

Images make programs more fun. And in the Flash world, it is all about images. There are essentially two places that your images can come from. You can get them from the internets or you can load them from your Flash project. I've been trying to do both, and finally I've figured out how to do this reliably using the FlashDevelop tool.

Mostly.

Today I'm going to look at loading images from your library, the one that should be the easiest to do. These notes apply to FlashDevelop 3.0.6 which you can find here. I’ve found this stuff out while playing with my Chumby, but you can use the techniques for any flash program.

Say I have an image called “one.png” that I want to add to my project. It just contains the number one:

one

First thing I do, is add it to the library directory in my project:

image

It is now in there, along with the font that I’m using to display messages. Note that it is displayed in black though. This is bad, in that it means that it is not part of my project. Attempts to load it won’t work. To make it part of the project I need to right click on it and select “Add to Library” from the context menu that pops up:

image

Now the item in the project turns blue, which is good  because it means it has an outside chance of working. Next thing i want to do is load the image into a media clip.  I can do this in the Main method of the application class if I like:

static function main(mc:MovieClip)
{   

    var oneImage:MovieClip;
    oneImage = mc.attachMovie("library.one.png", 
                 "oneImage",
                 mc.getNextHighestDepth());
}

The first parameter is the name of the file in the resource. Warning: the property information for a library item (the thing you can see above) has a useful appearing “Insert into document” tab, which will insert the path to your resource into your program. For my one image above it suggests the helpful path “libary/one.png”. This doesn’t work. You need to separate the directories in the path using dots, as I have in my sample code above. I’ve no idea why this doesn’t work, perhaps someone out there can tell me.

The second parameter is the name of the resource you are creating.

The third parameter is the draw depth. You can ask the parent movie clip to give you the next highest draw depth. If you set your new image to this depth it will appear on the screen. If you put this code into the main method of your program it will fetch and draw the item.

image

Good eh?

If you get any part of it wrong,  get the path wrong, forget to add the item to the library or anything, then it won’t work and you will not get an error. I hate this. The only thing you can do is add trace statements to see what your program is doing. these are printed out

trace(oneImage._url);

This will display the url of the file that has been loaded.

Saturday
Jan162010

Mad World Shopping

4280799929

Three bags full

Did the shopping today. All on my own. I did have a list, but even so I’m very impressed with myself. Anyhoo, the supermarket was selling off Mad World for the Nintendo Wii for a very nominal sum and so I invested in a copy.

Note: I never buy a computer game. I invest in a copy. This makes it sound much less like a waste of money. Although, perhaps investing is a waste of money these days too .

Anyhoo, once I had got home and figured out which cupboard to put things in (Hint: Use the very cold cupboard with a light inside, I think it is called a fridge, for items like yoghurt and sausages) I had a go at the game.

It is very bloodthirsty, violent and foul mouthed. You play a participant in a warped TV gameshow who has a chainsaw for an arm.  The gameplay revolves around extreme violence where you use the chainsaw, road signs and just about anything else around to bloodily despatch people who are presumably very bad. At least I hope they are/were…..

When you go into chainsaw mode the Wii remote actually makes chainsaw noises. The game  is like being inside a slasher movie and has absolutely no moral centre. I quite like it.