Random Image

Hello,

I have been toying around the code for a quite some time but I haven’t been able to get it to work. In the flash XML gallery tutorial, how do I make the first image random (rest of the gallery will follow the regular order of p +1). The following is the actionscript to load the first image:
[COLOR=DimGray]
[/COLOR][SIZE=1][COLOR=DimGray]function nextImage() {

if (p<(total-1)) {
    p++;
    if (loaded == filesize) {
        picture._alpha = 0;
        picture.loadMovie(image[p], 1);
        name_txt.text = name[p];
        dimensions_txt.text = dimensions[p];
        addinfo_txt.text = addinfo[p];
        addinfo2_txt.text = addinfo2[p];
        addinfo3_txt.text = addinfo3[p];
        addinfo4_txt.text = addinfo4[p];
        picture_num();
    }
    
}

}[/COLOR][/SIZE]

I’m thinking that I need to variable that will generate a random integer and replace that with p. Thanks guy! :kommie:
[SIZE=1][COLOR=DimGray]

[/COLOR][/SIZE]