PDA

View Full Version : Next and Previous Buttons on Portfolio Site


astinso2
05-03-2010, 12:17 AM
I am desparately trying to figure out how to use my next and previous buttons so that the user can view up to 3 pictures per project/thumbnail in the UILoader image space. I have done all of this on the first frame so far.

Below is the AS in full from my projects page. As of right now it is a page connected to the index that has 10 thumbnail images on the side that are loaded externally and appear larger when clicked on in the UILoader space that I have on the page.

Thank you for your time!!



//LOAD THE THUMBNAILS
var thumbLoader:Loader = new Loader();
thumbLoader.load(new URLRequest("portfolio/thumbs/KLH.jpg"));
thumbLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, thumbLoaded);
function thumbLoaded(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.buttonMode = true;
allThumbnails.addChild(thumbLoader);
thumbLoader.addEventListener(MouseEvent.CLICK, loadMainImage);
function loadMainImage(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/KLH.jpg";
selectedTitle.text = "KLH Massage";


}
}

var thumbLoader2:Loader = new Loader();
thumbLoader2.load(new URLRequest("portfolio/thumbs/Basquiat.jpg"));
thumbLoader2.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded2);
function thumbLoaded2(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader2);
thumbLoader2.x = 100;
thumbLoader2.addEventListener(MouseEvent.CLICK, loadMainImage2);
function loadMainImage2(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/basquiat.jpg";
selectedTitle.text = "Basquiat Examination: Art Exhibit";


}
}

var thumbLoader3:Loader = new Loader();
thumbLoader3.load(new URLRequest("portfolio/thumbs/books.jpg"));
thumbLoader3.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded3);
function thumbLoaded3(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader3);
thumbLoader3.y = 100;
thumbLoader3.addEventListener(MouseEvent.CLICK, loadMainImage3);
function loadMainImage3(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/Books1.jpg";
selectedTitle.text = "Yale American Music Series: For the Record";

}
}
var thumbLoader4:Loader = new Loader();
thumbLoader4.load(new URLRequest("portfolio/thumbs/dominoes.jpg"));
thumbLoader4.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded4);
function thumbLoaded4(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader4);
thumbLoader4.x = 100;
thumbLoader4.y = 100;
thumbLoader4.addEventListener(MouseEvent.CLICK, loadMainImage4);
function loadMainImage4(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/dominoes.jpg";
selectedTitle.text = "I <3 Dominoes";

}
}


var thumbLoader5:Loader = new Loader();
thumbLoader5.load(new URLRequest("portfolio/thumbs/db.jpg"));
thumbLoader5.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded5);
function thumbLoaded5(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader5);
thumbLoader5.y = 200;
thumbLoader5.addEventListener(MouseEvent.CLICK, loadMainImage5);
function loadMainImage5(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/db.jpg";
selectedDesc.text = "A Washington state brewery dedicated to the adventerous spirit of notorious skyjacker DB Cooper. Who is suspected to have landed in this region which is also known for it's hop growing.";


}
}

var thumbLoader6:Loader = new Loader();
thumbLoader6.load(new URLRequest("portfolio/thumbs/canopy.jpg"));
thumbLoader6.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded6);
function thumbLoaded6(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader6);
thumbLoader6.x = 100;
thumbLoader6.y = 200;
thumbLoader6.addEventListener(MouseEvent.CLICK, loadMainImage6);
function loadMainImage6(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/canopy.jpg";
selectedTitle.text = "DB's Canopy Grill";

}
}
var thumbLoader7:Loader = new Loader();
thumbLoader7.load(new URLRequest("portfolio/thumbs/groove.jpg"));
thumbLoader7.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded7);
function thumbLoaded7(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader7);
thumbLoader7.y = 300;
thumbLoader7.addEventListener(MouseEvent.CLICK, loadMainImage7);
function loadMainImage7(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/Groove1.jpg";
selectedTitle.text = "Letraset: Groove Art Supplies";


}
}

var thumbLoader8:Loader = new Loader();
thumbLoader8.load(new URLRequest("portfolio/thumbs/fdf.jpg"));
thumbLoader8.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded8);
function thumbLoaded8(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader8);
thumbLoader8.x = 100;
thumbLoader8.y = 300;
thumbLoader8.addEventListener(MouseEvent.CLICK, loadMainImage8);
function loadMainImage8(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/FDF1.jpg";
selectedTitle.text = "FlyingDragonFilms.com";

}
}


var thumbLoader9:Loader = new Loader();
thumbLoader9.load(new URLRequest("portfolio/thumbs/cmg.jpg"));
thumbLoader9.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded9);
function thumbLoaded9(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader9);
thumbLoader9.y = 400;
thumbLoader9.addEventListener(MouseEvent.CLICK, loadMainImage9);
function loadMainImage9(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/CMG2.jpg";
selectedTitle.text = "CowtownMediaGroup.com";


}

}
}

var thumbLoader10:Loader = new Loader();
thumbLoader10.load(new URLRequest("portfolio/thumbs/ai.jpg"));
thumbLoader10.contentLoaderInfo.addEventListener(E vent.COMPLETE, thumbLoaded10);
function thumbLoaded10(event:Event):void {
//add the thumbnail to the allThumbnails instance
allThumbnails.addChild(thumbLoader10);
thumbLoader10.x = 100;
thumbLoader10.y = 400;
thumbLoader10.addEventListener(MouseEvent.CLICK, loadMainImage10);
function loadMainImage10(event:MouseEvent):void {
largeUILoader.source = "portfolio/large/amelia.jpg";
selectedTitle.text = "AmeliaEarhart";

}
}