Has anyone come up with a good way to deal wiuth arrays?
I want to dynamically add and remove buttons from an array of buttons..
How about a linked-list.. will this work alright in this environment?
Or will a linked-list be too resource intensive?
I don't want to have to cludge by array of buttons..
 
But for those wondering how I would go about doing that..
 
1) the buttons themselves don't go into an array
2) You maintain an array of handles to buttons..
3) when you create a button, add it's handle(reference to the object) to the array of handles
4) when you delete and object you FIRST remove it's handle..
 
var tmpArray = new Array();
for (var i=0;i<Handles.length;i++){
    if (Handles[i] !== TheHandle){
        set tmpArray[tmpArray.length] = Handles[i];
    }
}
delete Handles; //what's the correct way to kill an array?
var Handles = new Array();
for (var i=0;i<tmpArray.length;i++){
        set Handles[Handles.length] = tmpArray[i];
    }
}
 
Will this work? will deleteing the handles array cause us to loose the reference to the object?
Or will the references saty true as they are actuall references to button ojects?
 
Feedback please!!
 
Doug Melvin

Reply via email to