In your first example, the first one is an anonymous function, however as you
are using it, it makes no difference. A different example will make the reason why it’s called an anonymous function more plain.
“randomizePosition” is a named function. I can assign it to any number of
movie clips. If I had used the anonymous style syntax, it would have looked like this.
mymovie.onEnterFrame = function ()
{
this._x = random(300);
this._y = random(200);
}
// this is kind of uglY:
myothermovie.onEnterFrame = mymovie.onEnterFrame;
As you can see, it’s anonymous because the function wasn’t assigned a name (“randomizePosition”). This syntax is a little uglier when you’re going to be assigning the function to multiple movies. However, for one-shot movies, anonymous functions are fine, and produce slightly smaller code.
In terms of performance, it doesn’t really matter which method you choose.
My personal preference is to use named functions because most of my programming life I’ve been programming in languages which only support that kind (C for example).