actionscripter.co.uk Web and Multimedia Development
Flash, Flex, AIR, PaperVision
ActionScript 3.0 Specialist.

    

blog  portfolio  about
 


100 Abandoned Artworks

October 6th, 2008

There are two things I have had on my to-do list for a few years - 1. do a Generative Art project, and 2. do an Open Source project, so this month I have ticked off two boxes at once with my new 100 Abandoned Artworks site.

A year ago I saw Robert Hodgin speak at FOTB07, which introduced me to Processing, an Open Source Java-based programming language. It is always good to teach yourself a new language every few years, just to keep things fresh, and to give you new perspectives on your work. And while ActionScript is still great, as the language has evolved from the hacky AS1 to the strict, ordered, enterprise-focussed AS3, it has lost a lot of its sense of fun and experimentation; the thing that attracted me to the language in the first place.

So, while I can still use AS3 to make my clients happy, Processing can be my playground. Which is the idea behind 100 Abandoned Artworks (http://www.abandonedart.org). I don’t have the time, or the sympathetic business partners, to be able to emulate Hodgin’s sophisticated works, so instead I am intending to do a high-volume, fast turn-around project (the only thing I can do with a wife, child and 20odd clients to keep happy).

Over the next 100 weeks I will produce an experiment a week and throw it out there, in whatever state I have got it to before one of my dependents puts a stop to my playtime. But I will also post the source code, so if anyone wants to take these works and run with them, or adapt them for another medium, they are welcome too.

I’m hoping it’ll produce some good stuff, and you’ll be able to see a upward curve in the quality of the work over the two years. Make sure you subscribe to the feed, because the more subscribers I have, the harder it is for me to bow out and quietly abandon the project.

This is me bidding farewell to my weekends …



Flash Isometric 3D World Builder

September 9th, 2008

Progress with my Isometric Engine has been slow to static, seeing how I only ever seem to spend a day every six months or so on it (damn you paid work). But every time I play with it I come up with something cool to share, so now, if you have five minutes to kill, you can have a play with my isometric world builder.

Within the cube you create your own isometric spaces and structures, and rotate and zoom around them. Click on the image to launch, and have a play around.

There will, inevitably, be a game built with this thing one day soon, so this will be the level editor. If you come up with anything cool-looking feel free to email the XML to me, or post it below. With any luck, if the credit crunch starts biting and the work dries up, I may find a day free to finish the physics sometime in the next year. Don’t hold your breath though.



Nudes and Smoke

August 27th, 2008

This is going to take longer to explain than it did to build (literally 10 minutes, and 8 of those were spent googling for the image). Click above to see it in action.

Richard Lord was guest speaker at our Flash Brighton user group last night, presenting his Flint particle system. I think every creative coder has found themselves toying with particle effects at some point (do check out my generative stuff) but Rich’s system takes all the heavy lifting from the coding and just leaves the fun part. And it can create some really authentic looking smoke, in very few lines of code.

The movie above is my riff on a very old David Lynch photograph from his “Nudes and Smoke” collection (see here). A lot of Lynch’s “still” art work involves incorporating moving parts into paintings and sculpture, so I hope he would approve of this subtle animation.

Rich will be introducing Flint to a wider audience at FOTB08 next month.



Make Your Own Flash Carousel

August 22nd, 2008

The simplest ideas are always the best. I did a project a few months back with the very talented Paul Lloyd of FourTwo.net. We built a little Flash carousel component in AS3 for a corporate client. And it came out pretty well.

The data that runs it all came from a remotely hosted XML, so rather than use a fixed set of cards, a whole new application could be created just by pointing it at another XML. Which is what I have done here - making some of my blog posts look pretty.

Now here’s the cool bit - if instead of using a fixed URL I tell the swf file to read the path to the XML from the QueryString, it becomes reusable by anyone. Even you. Here’s an example:

This is the url of the carousel: http://actionscripter.co.uk/projects/carousel/

Create a new XML, and upload it somewhere, eg.
http://www.zenbullets.com/portfolio.xml

… then give the URL of the new XML to the carousel …
http://…/carousel/?http://www.zenbullets.com/portfolio.xml

… and, wahay, we have a slick looking carousel showcasing a selection from my portfolio.

The structure of the XML should be self explanatory, so feel free to try it. Except when you try it with your own URL it doesn’t work. Why is that?

There’s one more thing you need: you have to give permission for the Flash file to use data from your domain. Flash Player has very tight security features, and won’t let swfs grab data from other domains, unless that domain has said it’s okay by putting a crossdomain.xml file on the top level. This applies both to the URL of the XML and the URLs of any images specified inside that XML. For more info, see here. The crossdomain.xml I used for the example above is here, if you copy this and put it at the top level of the domain where you placed your XML/images it should do the trick.



Flash Snapshot Application - an AIR/Flickr/Moo mashup

May 27th, 2008

There’s lots of fun to be had with Moo mini-cards, and I’ve been getting good feedback on the batch of fractal cards I made recently, which were created by taking snapshots of one of my flash experiments. The magic behind this was so simple I may as well share it with you. All you need to create your own set is the Flex/AIR app I created, which you can download here, and a Flickr account. This is how it works:

You give the app the path to your swf, and hit enter. It then runs a function to start a timed loop, as follows:


private var _saveDir:File;
private var _timer:Timer;
private var _counter:int;
private function startSnapshot(url:String, time:Number = 5):void {
// loadedSwf is the name of the mx:Image that will contain the swf
loadedSwf.source = url;
// create a directory to store our snapshots
var dirName:String = "snapshots";
_saveDir = File.desktopDirectory.resolvePath(dirName);
var x:Number = 1;
while (_saveDir.exists) {
_saveDir = File.desktopDirectory.resolvePath(dirName + String(x++));
}
_saveDir.createDirectory();
// start loop
_counter = 1;
_timer = new Timer(time * 1000);
_timer.addEventListener(TimerEvent.TIMER, snapLoop);
_timer.start();
}

Then, while the swf plays, the timer loop fires this function every few seconds to take a snapshot:


private function snapLoop(e:TimerEvent):void {
// create a new BitmapData object based on the size of the loaded swf
var BMPData:BitmapData = new BitmapData(loadedSwf.width, loadedSwf.height, true, 0xFFFFFF);
// take a snapshot of the swf, and store it in the BitmapData object
BMPData.draw(loadedSwf);
// encode it as a jpg
var jpgEncoder:JPEGEncoder = new JPEGEncoder(80);
var jpgBytes:ByteArray = jpgEncoder.encode(BMPData);
// save it
var ourFile:File = _saveDir.resolvePath("snap" + _counter++ + ".jpg");
var fileStream:FileStream = new FileStream();
fileStream.open(ourFile, FileMode.WRITE);
fileStream.writeBytes(jpgBytes, 0, jpgBytes.length);
fileStream.close();
}

Note that the BitmapData snap may give unexpected results with transparent swfs, so it is best used with swfs that have a solid background.

Once you have a folder full of snapshots, upload these to Flickr. For this example I pointed the app at a local version of my favourite fractal experiment swf, to produce this set of images.

To turn these into mini-cards, the final step is to use Moo’s Flickr import option. Point it at the Flickr set you have created, pay your money, and in 10 days or so a pack of groovy cards pop through the postbox. Simple.



 
actionscripter.co.uk.com actionscripter.co.uk.com actionscripter.co.uk.com