flash Q
- Started
- Last post
- 12 Responses
- JamesEngage0
probably want to stick them in an array... and get a sorting component...
i'm doing something similar at the mo and it's a headfeck
- stewart0
in an array... maybe that is only possible with a static list?
i was thinking of a dynamic amount of swf-docs in a folder on the webserver, loaded dynamicly in a list.
anyway, thanks for the info!
- MR_T0
If you puit that loaded list into array, you willl be able to sort them alphabetically.
Cause the arranging will be done flash side, not server side.
- JamesEngage0
yep
- rabattski0
arranging can be done server side. e.g. if you use a php script to read out a specific folder, sorting it and parses back the sorted array to flash. depends on what you want to do with it later. if it's for regular updating purposes i would go with a php script so you don't need to edit the fla file over and over again. just upload the new .swf in the folder and the php script generates all you need.
- MR_T0
yep
- stewart0
so, there is no easy 'flash-only' solution
( and my website is hosted on a WinNT server, i can't use the php scripts )
- elkew0
If you're getting your external list from say an xml document, loop through the nodes pushing into an array (myArray). then use
myArray.sort();
This will working providing the name/src of external files is the first attribute
i.e. [ext_files src="swfs/a_name.swf" /]
etc. etc.
- stewart0
ow-kay
thanks. i'm going to puzzle with your advice.
- pixelbreaker0
function bubbleSort(a, b) {
var name1 = a;
var name2 = b;
if(name1 < name2){
return -1;
}else if(name1 > name2){
return 1;
}else{
return 0;
}
}/*
arrayName.sort(bubbleSort);
*/
- elkew0
Stewart, you've got mail!