I have this vertical scroller script that I got from Flashden.net
Unfortunately, I can't even figure out where to start to modify it so it displays the thumbnails in random order. I think this is the function
private function generate() {
Thumbs = remove(Thumbs);
Thumbs = create();
Thumbs.setMask(Mask);
toFront(TF);
toFront(BF);
var mc:MovieClip;
items = 0;
spos = -1;
tsh = 0;
var n:XMLNode = node.firstChild;
for (; n != null; n=n.nextSibling) {
mc = Thumbs.attachMovie("IDThumbnail", "THUMB"+items, Thumbs.getNextHighestDepth());
var lbh:Number = mc.LHeight;
tm = lbh;
mc.height = th;
mc.width = w;
mc.setData(n, hand);
mc._y = items*(th+tm+ts);
mc._x = 0;
if (n.attributes.selected != undefined) {
spos = items;
}
tsh += th+ts+tm;
items++;
}
tsh -= ts;
Thumbs._y = -tsh;
}
Can anyone make any sense out of this?
yuk I would rewrite from scratch, that is horrible to read code, unmaintainable.
if you create an array of possible item positions before current loop
var count:Number = 0; var arrayPositions:Array=[]; for ( n= node.firstChild; n != null; n=n.nextSibling) { arrayPositions[count]=count++; }
then later randomly extract item positions, so change current y setting to something like
//untested mc._y = arrayOfPositions.splice(Math.round(Math.random()arrayOfPositions.length),1)(th+tm+ts);
but test the code out of the current system before trying inside.
I know, this is pretty bad for a commercially sold script (even one that is sold for 10$). The support forum consists of people selling breast enhancements and the script author coming on every month or so to tell people "the scroller has certain limitations" to inquiries with "too many thumbnails" and "thumbnails are too large".
I'll have to check the support forum next time before spending ten bucks I guess.
Thank you for your help, JLM, I'll try that.