The Homepage of Daniel Hollands: Web Development Graduate!
4 Mar 2009
OK, so I realise that no one reads this blog (apart from Sue – who has to because of her job, hi Sue), but I figure I might try and do a bit more with it, and make it work for me.
I really like the idea of blogging everything I learn, the technique we use in the Advanced Web Design module, as it provides a useful place for reflection, in addition to a resource for the future, both to myself, and anyone else who might stumble upon it. Because of this, I want to extend this blog’s role to include posts about another one of my modules: Advanced Multimedia Scripting.
This module uses Flash – or more specifically ActionScript 3.0 – to teach scripting concepts, and as it’s a fairly hands on module, we normally end up building one or two examples of what we’ve just learnt after each session.
Up until now, there hasn’t been much of interest to share as we have been dealing with simple programming constructs such as conditional selection and loops, with nothing more than a traced output to show that our script was working, but this week we started to get to the juicy stuff, allowing me to actually build something fun.
So here it is, my first published Flash production.
It’s a snowman – or at least, an unfinished snowman.
It might not look like much (and to be honest with you, it probably isn’t much), but this was built using nothing but ActionScript code. I should go on to finish it: add some arms, maybe a mouth, etc. but I’d rather just skip to the next task – to make a simple hunter game.
I’ll get that uploaded as soon as I’ve finished it, but until then, enjoy the snowman.
In case anyone was interested, here is the code I used to make the Snowman.
var bgFrame:Shape = new Shape(); bgFrame.graphics.lineStyle(6, 0x000000); bgFrame.graphics.beginFill(0x00ff00); bgFrame.graphics.drawRect(20, 20, 500, 350); bgFrame.graphics.endFill(); addChild(bgFrame); var body:Shape = new Shape(); body.graphics.lineStyle(3, 0x555555); body.graphics.beginFill(0xeeeeee); body.graphics.drawEllipse(190, 120, 170, 240); body.graphics.endFill(); addChild(body); var head:Shape = new Shape(); head.graphics.lineStyle(3, 0x555555); head.graphics.beginFill(0xeeeeee); head.graphics.drawCircle(275, 120, 50); head.graphics.endFill(); addChild(head); var eye1:Shape = new Shape(); eye1.graphics.lineStyle(3, 0x000000); eye1.graphics.beginFill(0x111111); eye1.graphics.drawCircle(250, 110, 3); eye1.graphics.endFill(); addChild(eye1); var eye2:Shape = new Shape(); eye2.graphics.lineStyle(3, 0x000000); eye2.graphics.beginFill(0x111111); eye2.graphics.drawCircle(280, 110, 3); eye2.graphics.endFill(); addChild(eye2); var nose:Shape = new Shape(); nose.graphics.lineStyle(3, 0xFF6600); nose.graphics.beginFill(0xFF6600); nose.graphics.moveTo(265, 130); nose.graphics.lineTo(275, 140); nose.graphics.lineTo(255, 140); nose.graphics.lineTo(265, 130); addChild(nose);