Combine Scripts

Hi,

How can I combine Script #2 with Script #1? I want to be able to keep the linkArray name different from the folio_arr names because the folio_arr names are the same as how the swf files are named and the linkArray names are how they appear in text in flash. Script #2 also contains the onRelease functionality. Thanks

Script #1
[AS]
// --------------------------------------------------------------------------------------
// array of link names used in the dynamic text field name dText
linkArray = [“01”, “02”, “03”, “04”, “05”, “06”, “07”, “08”, “09”, “10”, “11”, “12”, “13”, “14”, “15”, “16”, “17”, “18”, “19”, “20”, “21”, “22”, “23”, “24”];
// our starting depth
depth = 6;
// our starting coordinates
startX = 255;
startY = 133;

// our multiplication number so the clips are stacked on each other
n=0;
// our loop that creates a link for each element in linkArray
for (var i = 0; i<linkArray.length; i++) {
// if i equals have the array length
// we should start a new row
if(i==Math.ceil(linkArray.length/2)) {
startX+=130
n=0;
}
// attach the movieClip to _root’s timeline
var x = _root.attachMovie(“dynamicLink”, “dlink”+depth, depth++);
// put them in their places
x._x = startX;
x._y = startY+(x._heightn);
// assign their text
x.dText.text = linkArray
;
// incriment the number
n++;
}
[/AS]

Script #2
[AS]
// --------------------------------------------------------------------------------------
folio_arr = [“jbf”, “crn”, “mrd”, “ald”, “emi”, “win”, “boo”, “tox”, “exc”, “wwn”, “qua”, “eud”, “sms”, “yat”, “tag”, “ten”];
// --------------------------------------------------------------------------------------
for (i = 0; i < folio_arr.length; i++) {
this[“folio” + (i + 1)].i = i;
this[“folio” + (i + 1)].onRelease = function() {
loadMovie(“portfolio/” + folio_arr[this.i] + “.swf”, “folioClip”);
folioClip.preload(627, 201, 170, 16, 3, 0xD1D1D1, 0x333333);
};
}
// --------------------------------------------------------------------------------------
unloadMovie(“folioClip”);
[/AS]