PDA

View Full Version : Not Attaching Array name



wyclef
July 10th, 2003, 02:17 PM
:tie: Hi, this script is not attaching the array name to the beginning of .swf. Any ideas why?



folio_arr = ["aa", "bb", "cc", "dd", "ee", "ff"];
// --------------------------------------------------------------------------------------
for (i=0; i<folio_arr.length; i++) {
this["folio"+(i+1)].onRelease = function(){
loadMovie(folio_arr[i]+".swf", "folioClip");
folioClip.preload(627, 201, 170, 16, 0, 0xDCDCDC, 0x000000);
}
};

nunomira
July 10th, 2003, 03:06 PM
hi, because the i doesn't get that far!
try tracing it!

try this:


for (i = 0; i < folio_arr.length; i++) {
this["folio" + (i + 1)].i = i;
this["folio" + (i + 1)].onRelease = function() {
loadMovie(folio_arr[this.i] + ".swf", "folioClip");
folioClip.preload(627, 201, 170, 16, 0, 0xDCDCDC, 0x000000);
};
}

the i will be a property of each movie clip, and you can call it using this.i

wyclef
July 10th, 2003, 03:39 PM
:cowboy: Thanks Partner!