Archive for the ‘Actionscript’ Category

The Algorists

Friday, November 4th, 2005

So, I’m doing a creative workshop with Joshua Davis tomorrow. As part of my preparation I’ve been reading up on art history relating to the branch of computer art known as “Algorism” or “Algorithmic” art, which, (if you subscribe to the concept of movements), Mr. Davis could be considered part of. A lot of his ideas, especially the concept of an art making machine, are very much in line with the algorists’ school of thought. Interestingly, the movement goes back to the 1950s, and also includes artists who do not use computer displays or prints as their medium. For example, Jean Pierre Hebert works with dry sand, creating incredible intricate patterns over time. In some ways, this is an ancient idea - monuments such as Stonehenge and Newgrange could be described as algorithmic, in so far as they follow a repetetive, logical (yet intricate) patter throughout their construction. Somehow, to me, sand - which is usually seen as a symbol of impermanence (see the Tibetan Sand Mandalas) seems more permanent than purely digital art does now.

What’s unique about the Algorists though, is that their work takes “non-representational” art to another level. Most non-representational art works from emotional or temporal subjects, concepts which are very much rooted in our objective reality (happiness, abjection, a nude descending some stairs, etc.) - so in that sense, they actually are representational - just representing non-visual subjects, or visual subjects in a more expressive way. However, Algorithmic art creates a microcosm of its own, in that each algorithmic work creates a system, a closed form in itself. Algorithmic art is beautiful, because each piece creates its own frame of reference - the inherent qualities of the algorithm. These can be beautiful to us, either because we can deconstruct the algorithms which make up the ordered rigour of mathematical iteration, or because we can recognise the mysterious yet familiar echoes of the natural world.

Here’s a great quote from Roman Verostko:

For the past 40 years I have worked with pure visual form ranging from controlled constructions with highly studied color behavior to spontaneous brush strokes and inventive non-representational drawing. Such art has been labeled variously as “concrete”, “abstract”, “non-objective”, and “non-representational”. In its purest form such art does not re-present other reality. Rather “it is” the reality. One contemplates a pure form similar to the way one might contemplate a fine vase or a sea shell.

Eclipse Template Joy - Sorry, I’m Single

Tuesday, October 4th, 2005

I’ve recently become increasingly enamoured with the joyful wonder that is Eclipse’s code templates - be they in FDT or ASDT, they fill my heart with a warm fuzzy sense of joy and make me tipsy with the raw coding power available to me. So, here’s a code template for my particular flavour of the ubiquitous Singleton Pattern:

/**
 * @author ${user}
 */
class ${enclosing_package_and_type} {

	private static var _instance : ${enclosing_type};

	private function ${enclosing_type}() {
		${cursor}
	}

	/**
	 * @return singleton instance of ${enclosing_type}
	 */
	public static function get instance() : ${enclosing_type} {
		if (_instance == null)
			_instance = new ${enclosing_type}();
		return _instance;
	}
}

This is slightly cleaner than the more traditional version (which ships with FDT) in that it uses an implicit getter function for the instance - this just means that you can write slightly cleaner looking code - for example:

MyManagerClass.instance.myFunkyMethod(myParams)

vs.

MyManagerClass.getInstance().myFunkyMethod(myParams)

Works for me, anyway.

Actionstep

Friday, September 23rd, 2005

Ok - this project really inspires me. For all the slashdot weenies who say “flash isn’t open source” - here’s a project which implements an open source unix UI API, based on NextStep, (OpenStep), which uses an open source compiler (MTASC) and is run within an open source community (OsFlash.org), and released under an open source BSD style licence.

Did I mention that it’s open source?

ADFs - the heart of the Saffron Font engine

Friday, August 26th, 2005

I was reading up on the Saffron font engine technology today, and as I was skimming this paper I noticed that the technology seems to use quadtrees and octtrees, which are popular concepts in collision detection space partitioning. Basically, it works on the principle of scanning an object, and analysing the amount of detail in it, and only storing higher resolution data of it if needed. For example, if we have a 200×200 square, and there’s only a 25×25 box in the top right hand corner, we can ignore 3/4 of the scene by dividing the square by four and discarding the empty sections. We can then go further, by dividing the one occupied square by four again, and again, ad infinitum. This lets us draw and query the scene much more quickly, and means that less data is needed to represent it. It also means that the coordinates themselves will be limited to a smaller range, because they only need to be stored in terms of the coordinate space of the cell they are in. This can potentially cut the size of the data in half again. ADF seems to use the corners to represent edges, so it can avoid too many levels of recursion into a shape, while still maintaining the same level of quality.

AMFPHP - INFRNO ?

Friday, December 10th, 2004

A few days ago, I casually weighed in on the “new name for AMFPHP” debate - I suggested the name “INFRNO”, which was meant to be a reference to the numerous recursive acronyms already in use in various open source/free software projects- INFERNO’s not Flash Remoting, No. To my surprise, it has gained some traction, and it seems to have inspired people, as there’s already several logo designs for it.

Anyway, opinion is not totally unanimous on this, however, as a a few people aren’t so thrilled to change the name at all. As far as I understand though, the name *is* going to change, as the PHP people don’t like other people using their brand. So if you care one way or the other, send an email to:

name_vote@amfphp.org

And tell them what name you want. I think the candidates so far are: INFRNO, Plash, amph, and Falcon. I’m sure they’d be open to other suggestions.

The _root of all evil…

Tuesday, November 16th, 2004

Whenever it’s late and I’m trying to fix someone elses code, which I know next to nothing about, and that code uses loads of references to _root.someMadInstanceName.someFunction(), a certain set of Slayer lyrics comes to mind…

“The root of all evil is the heart of a black soul,
A force that has lived all eternity.
A never ending search for a truth never told,
The loss of all hope and your dignity.”

I must admit that I hate _root. It’s almost always used to get around some crazy scope problem or other, and it usually makes it really hard to figure out what’s going on in someone else’s code when it uses _root.something() all over the place. For me, using _root is like admitting failure.

However, this afternoon,I was asked if I could think of a way to somehow extend _root in an AS2 class, so _root methods could be safely used in AS2 without having to put a extra movieclip in the flash display tree just to hold the class. What I came up with was the idea of creating an instance of class object in _root, and using __resolve to redirect the calls to _root into it. Check this out:

In the root timeline of your movie:

import MyMuchBetterRoot;
betterRoot = new MyMuchBetterRoot(this);

__resolve = function (name) {
        //if you wanted to monitor all the calls to _root, you could do so here
	trace("resolving "+name);
        var f:Function = function () {
            betterRoot[name].apply(this,arguments);
        };
   return f;
}

In the class MyMuchBetterRoot.as:

class MyMuchBetterRoot extends MovieClip{

        //pass in and store a reference to _root, in case
        //you need to get to it later
       private var rootRef :MovieClip;

       public function MyMuchBetterRoot(rootRef){
               trace("I am a much better root than "+rootRef);
               this.rootRef = rootRef;
       }
       //random test method
       public function helloWorld(foo, bar){
               trace("Hello World");
               trace("foo="+foo);
               trace("bar="+bar);
               rootRef.foo = foo;
               rootRef.bar = bar;
       }

        public function __resolve(name){
        //if a method doesn't exist in the class, trace out an error
         trace("ERROR:Function "+name+" does not exist.");
        }

}

You then move all the _root methods into MyMuchBetterRoot.as, and let the rest of the movie call non-existant functions on _root. These calls will automatically get re-routed to the class, or, if they’re referring to functions that don’t exist, you’ll get an error trace, with the name of the function you’re calling.
This means you get the best of both worlds - you can have methods on the root, but still have them in an AS2 class, and you can also track those pesky calls to _root, and possibly figure out where they’re coming from. Although if I can, I usually avoid using _root altogether, I’ll definitely be using this method again.

Next Generation Flash Player

Monday, October 25th, 2004

Colin Moock’s Blog is now showing a video of the first public demonstration of the new, next-generation flash player. I looks really amazing - it’s got, (presumably among other things) a new font display technology called Saffron, *much* faster graphics playback, alpha transparency for video, and some nifty bitmap filter effects. Can’t wait.

A solution to component bloat?

Thursday, October 14th, 2004

A company in London, Ariaware have just released a product which optimises flash projects by extracting the classes and letting you load them at runtime… So you don’t have to load 70+k of classes you’ve already loaded just to get components to work properly :) Very cool.

Would people use a Flash component-specific mailing list?

Tuesday, September 28th, 2004

I’m just as guilty as the next guy of bitching about flashcoders being flooded with “broken component whinging” - people asking loads of component specific questions, which have largely eroded the quality of the flashcoders mailing list - however, I think it would be very useful to have a list which specifically dealt with component problems - thereby getting it all in one place and lightening the load on flashcoders. Would people use a list like this? It would be a good place for the component gurus to hang out, and the more abstract AS questions would continue to go to flashcoders.

Anyway, the list page is here, we’ll see if anyone signs up to it.

MMUG conference notes

Friday, September 17th, 2004

Well, the talk last night went well, I think, I didn’t screw it up too bad, or fall over or knock down the podium or anything. I had fun and met a lot of interesting new people and generally I think everyone had a good time. A couple of people have asked for the notes for the talk I gave, so I’ve put them online here:
download MMUG conference notes

They’re in flash fomat, just unzip the files and open the html page. Not sure how much sense they’ll make by themselves, but there’s some interesting stuff in there.