Simple for loop question

Hi guys,

I’m working on a project that has 28 thumbnails already on the time line, these have been imported to the stage and aligned for use.

now instead of going into each button with “this.onRelease” or going onto the main timeline with “slide1.onRelease”… is there a way to asign these image slides a series of values using a “for loop”?

I’ve had a go but cant get it to work, maybe it won’t? All the values for each slide can be calculated from the loop number so I thought this would save alot of lines of code and make it look a bit tidier.

Something like this.


for(var i=1; i <= 28 ;i++){ 

    _level0.container.slide*.onRelease = function() {
        player.contentPath = "flv/"+i+".flv";
        gotoAndStop(i+1);
    }
}

Hoping somebody can enlighten me, or say its dumb

thanks for your time