# Combine Scripts

**URL:** https://forum.kirupa.com/t/combine-scripts/92673
**Category:** Uncategorized
**Created:** [October 20, 2003, 2:27pm UTC](https://forum.kirupa.com/t/combine-scripts/92673 "2003-10-20T14:27:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wyclef](https://avatars.discourse-cdn.com/v4/letter/w/65b543/32.png) [@wyclef](https://forum.kirupa.com/u/wyclef)
#### Post date: [October 20, 2003, 2:27pm UTC](https://forum.kirupa.com/t/combine-scripts/92673/1 "2003-10-20T14:27:44Z")

</div>

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.\_height_n);  
// 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]
