I just want a damn random number, no repeats, how hard could this really be?

i have been trying to figure this out for a few hours now. actionscript seems to have no main method, and i cant seem to follow its flow. i have been trying to generate a non repeated random number for a couple of hours now and im getting extremely pissed off that its not working.

// define pictures
pic_arr = ["images/goldstein.png", "images/kyle.png", "images/timmy.png"];
var oldRN:Number = 10;
player_mc.createEmptyMovieClip("holder1",2);
this.onLoad(display());

function display() {
    ranNum = Math.floor(Math.random()*pic_arr.length);
        while(ranNum == oldRN){
        ranNum = Math.floor(Math.random()*pic_arr.length);
        }
        trace(ranNum);
        oldRN = ranNum;
        player_mc.holder1.loadMovie(pic_arr[ranNum]);
};