I think you might be able to get this to work with fixed arrays. Usually with the javascript arrays you use float, int, string, etc (not GameObject from what I know).
var arr : GameObject[]; //make a fixed array
arr = new GameObject[1]; //resize the array to 1;
arr[0] = GameObjectDisappear;
you won't be able to see it in the editor, but at least you might not get the error.
You can't resize the array that easily though =( plus you can't use stuff like "push," you have to assign manually.
[edit:]Also, from what I remember, an object cannot "die"/be destroyed until all of the references to it are gone, thus the destroy function might behave oddly, since it has a reference in the array you are making. If you are trying to memorize which coins have been collected in a platformer, or something like that, try getting two fixed arrays, one with a boolean called collected? and the other with a vector3 called position (or something like that).
↧