Function Bank?

i learned a LOAD of all sen’s post’s here and there :}
and http://proto.layer51.com is one of my favorieten(dam that’s dutch :sigh: )

:wink: :sigh:

I am batman…you should submit that to FreddyThunder as a pickup line.

but he has changed his footer!!

Just wondering thor, isn’t it unnecessary to reverse something twice? Curious minds want to know :wink:

…on a more relevant note, I have never used prototypes before, but they seem really useful! I may have to give that a shot sometime. I only barely started using Event Handlers a few weeks ago :slight_smile:

*Originally posted by thoriphes *using prototypes are a way to add a common function to an existing object type, like movieclip, or Array, or even math.

when you create a new object, a set of functions are available for that object. for example, array has split, pop, push, etc…you can add a function like reverseX2 like this:

Array.prototype.reverseX2 = function () {
this.reverse();
this.reverse();
};

which is completely unecessary (it reverses the order of an array twice :sigh:**), but for the sake of example, shut up!

now everytime you make a new Array object, you can use that function:

arr1 = new Array();
for (i = 0; i < 10; ++i) arr1* = i;
arr1.reverseX2(); // array is now the same as it's always been, but we did something !

See how it works? mind you though, that prototypes will only work with the same objects. reverseX2 will not work on a MovieClip or Sound object. the keyword “prototype” is telling flash to apply this functions to all objects of this type.
:whistle:

LOL! and a bomb from kirupa! :wink:

haha, don’t worry thor - I was just twisting your leg…all the way around and into a pretzel :slight_smile:

[just a side note - I was searching my name]
Master64 - you can still put in pickup lines at:
http://www.freddythunder.com/home.php?goto=footer

hahaha!!!
I got like 200 pickup lines in the four days it was up. I’ll update it soon!!

slammed by kirupa… the master of motion tweens :wink: