hi all,
i hoping out there me scrollpane issue in cs5.
the code below adds in thumbnail @ bottom , once click bigger image appears via uiloader @ top. works fine, added scrollpane components, , gave instance name of myscrollpane. added 'myscrollpane.source = allthumbnails;' @ top of code, , 'myscrollpane.update();' within code advised training video.
it seems updating scrollpane ok there no scroll @ bottom scroll through thumbnails! if squash height of scrollpane, verticle scroll works if reduced width nothing happens, missing trick! scrollpane verticle , horizontal scroll set auto , haven't touched of settings.
is there code need add?
this of code. have 10 images in total , rest of code duplicating below:
myscrollpane.source = allthumbnails;
var thumbloader:loader = new loader();
thumbloader.load(new urlrequest ("small/photo1s.jpg"));
thumbloader.contentloaderinfo.addeventlistener(event.complete, thumbloader);
function thumbloader(event:event):void{
//addthumnails
allthumbnails.addchild(thumbloader);
myscrollpane.update();
allthumbnails.buttonmode = true;
thumbloader.addeventlistener(mouseevent.click, loadmain1);
function loadmain1 (event:mouseevent):void {
largeuiloader.source = "large/photo1l.jpg";
}
}
var thumbloader2:loader = new loader();
thumbloader2.load(new urlrequest ("small/photo2s.jpg"));
thumbloader2.contentloaderinfo.addeventlistener(event.complete, thumbloader2);
function thumbloader2(event:event):void{
//addthumnails
allthumbnails.addchild(thumbloader2);
thumbloader2.x=120;
myscrollpane.update();
allthumbnails.buttonmode = true;
thumbloader2.addeventlistener(mouseevent.click, loadmain2);
function loadmain2 (event:mouseevent):void {
largeuiloader.source = "large/photo2l.jpg";
}
}
i think cracked it, allthumbnail uiloader had wider scrollpane , worked! super :-)
Comments
Post a Comment