hi,, a new member here, am just starting to learn adobe flash..I have heard some people saying "stop learning it, it's outdated," but I would like to try it first.. I have been making a simple code in ACTIONSCRIPT3, what it does is that it generates a random name from list of array if the Button generate is clicked, It works just fine however I am having a hard time on how can I restrict it from Generating Repeated Name.NO REPEATED NAMES MUST BE GENERATED. THank you and advance, I appreciate any help I could get.

My code goes this way.
[B]import flash.events.MouseEvent;


var names:Array = ["nameA","nameB","nameC","nameD"];

generate.addEventListener(MouseEvent.CLICK,generat eName);
function generateName(event:MouseEvent): void{

var randomSurname= names[int(Math.random() * names.length)];
result.text=randomSurname.toString();

}
[/COLOR][/B]