The intro:
A while ago I made a post about loading images in a grid and an example of how to use the document class. Basic stuff, I know, but it’s a good base to learn/start from.

What I am planning on doing now – I actually already started – is creating a couple of cool ways to display images: basic image galleries. I’m planning on doing a couple so if you have ways that you want me to try out shout them out in the comments.

All galleries will load images out of an xml, so my source files include a custom xml loader. First one up is a circle gallery. All my examples use Tweener for the code animations, so I suggest you download it.

My first example is a circle image gallery by using sine & cosine – that’s Math – which you can see in the preview. The flash file contains alot of comments to explain my actions but it’s really pretty simple once you get the hang of it.


The quick tips:
Flash does not use degrees, but radians. Luckily there’s a simple formula for this:

radian = angle * Math.PI / 180;



The cosine of an angle will give us an x coordinate and the sine of that same angle will give us the y coordinate:

pic.x = Math.cos(radian);
pic.y = Math.sin(radian);



The example:

Get Adobe Flash player




The settings:
Inside the xml you can add pictures and choose the radius of the circle.


The aftermath:
You can download the source here. This example is intentionally kept basic but is very versatile and easy to expand. With a little bit of code you can add multiple-page functionality, more animation, maybe even load your flickr account pictures in it with a link to the high-res version! Anyway, the possibilities are endless. Go ahead and try some stuff out! Fly my pretties, fly!