PDA

View Full Version : Array problem


emedia
06-20-2005, 05:05 AM
Hi

I'm having a problem with this code.
It's get's its data from an asp page which is ouputting correctly.

The problem I am having is that the download_title is using the arrayed values correctly (i.e different text for each item), but the download_link2 is using the last value in the array for all of the items (attached movies).

Any ideas?

Thanks in advance

==
if (arrayManuals.length>0) {
//
containerRef.title1_txt._visible = true;
containerRef.title1_txt._y = placement_y;
placement_y += containerRef.title1_txt._height+spacer;
//

for (i=0; i<arrayManuals.length; i++) {
//
if ((arrayManuals[i].ManualInfo != "") & (arrayManuals[i].ManualURL != "")) {
//
var download_title = arrayManuals[i].ManualInfo;
var download_link2 = imagePath+arrayManuals[i].ManualURL;
//
item = containerRef.attachMovie("download_with_text", "item"+itemCounter, 10+itemCounter);
itemCounter++;
//
item._x = 10;
item._y = placement_y;
//
item.content_txt.htmlText = "<b>"+download_title+"</b>";
item.download_btn.onRelease = function() {
getURL(download_link2, "_blank");
};
//
placement_y += item._height+spacer;

}
}
} else {
//
containerRef.title1_txt._visible = false;
}

madgett
06-20-2005, 05:17 AM
Put trace(download_link2); right after you declare it as a var. Then post what the output says so we can see what it's getting inbetween.

emedia
06-20-2005, 05:58 AM
only problem is this uses a webservice which makes it hard to test locally.

I have put text boxes in the item to see what link it's getting in the download_link2 variable and this is showing the correct URL..but the buttons still has the wrong url associated with it on release.

you can see this in action at http://www.playbillvenues.com/main_test.swf in the client area login:test password:test.

most bizarre

madgett
06-20-2005, 06:06 AM
You sure you want to use the bitwise &? Instead of && (Logical AND):
if ((arrayManuals[i].ManualInfo != "") & (arrayManuals[i].ManualURL != ""))

emedia
06-20-2005, 06:24 AM
probably not :o

Have changed it..but I don't think this is the problem (didn't fix it anyways)

thanks for the help on this