Get instance name in a class

Hello!
I have searched around a while, but couldn’t find what i’m looking for.

I have created a class: Persons
when I make an instance of this class I want to get the name of this instance and save it as a static var (Array). I want to do this so that i later can call a static function to all instances.

Like this:
var noen: Persons=new Persons(“John”);
var neon: Persons=new Persons(“Mike”);
var neonnoe: Persons=new Persons(“Karl”);
Persons.jumpAll();

And then everybody jumps. (No mater what I called the instances.)

Does anybody know how to do this?
Thanks for your attention.

Mr Amod

I’m not to much up to date on OOP, but couldnt you like… MAke 2 classes instead? Where one is the class for the actual ‘person’ and the other class is… Lets say, the parent class, ‘persons’?

I mean, like when you create a ‘person’ you could populate a array in the class ‘persons’ which would have a function called persons.jumpAll(); which would execute it for all the ‘person’ which has been pushed into its array?