Removing selective data from a variable

Thanks lostinbeta,

I really appreciate your help.

I am not that great at Actionscript and need a bit more help along the way if you don’t mind.

I have never set up an Array before. I don’t mean to sound dumb but how do I go about it. Do I need to get rid of everything I have done so far.

So far I have placed a variable on the main timeline and called it _root.sampleselect

Then in the external swf with all the colour sample buttons, I have coded each button to add to the variable accumulatively when clicked on

on (press) {
_root._root.sampleselect += “
colour1”;
}

Do I need to replace this with a new action for selecting the colours as well?

Would you mind breaking down the code you sent me and telling me what parts I need to customise and what parts should be left as they are?

How do I change the storage variable into an Array? OR am I on the wrong track?

Do I put all this code on every button, just for removing the colours from the array? Or does it do both actions (adding and deleting)?

on (press){
_root.myArray.push(“colour1”);
}

myArray = [“colour1”, “colour2”, “colour3”, “colour4”, “colour5”];
Array.prototype.removeItem = function(pos) {
this.splice(pos-1, 1);
return this;
};
myArray.removeItem(3);
for (var i = 0; i<myArray.length; i++) {
myString += myArray*+"
";
}
trace(myString);


Cheers,

the chad