i’m trying to create a simple dynamic gallery…
the basic premise is that i dont want to have to edit my flash file everytime i want to put a new picture up…so i 'm trying to make a gallery so that all i have to do is number the pictures in a certain way…and drop them in the appropriate folder.
so basically i’ve gotten pretty far into it…and have hit a wall…mind youall im not exactly a coder…i’m a 3d modeler.
but anyhoo heres what i have.
I’m using instances of a UI loader at the bottom… to serve as my thumbnails. the next and previous buttons just add or subtract from the source value…to scroll the thumbs.
now here is where i hit a problem.
i have a big instance of the UILoader to serve as the viewer.
i’m trying to create a custom property on each instance of the thumbnails…so that i can point the big viewer at the
currentTarget.“customproperty” …that way the big viewer would know what thumb was clicked…
but i cant add a custom property to a UI loader for some reason …event though it says its a movie clip…
any help?
heres my code:
var imageNumber:Number = 1;
var imageNumber2:Number = 2;
var imgRef1: Number = imageNumber;
var imgRef2: Number = imageNumber2;
smallImageLoader1.bigimage = imgRef1
checkNumber();
function checkNumber():void{
next_btn.visible = true;
prev_btn.visible = true;
if (imageNumber == 1){
prev_btn.visible=false;
}
}
next_btn.addEventListener (MouseEvent.CLICK,nextImage);
function nextImage (e:MouseEvent):void{
trace("next image");
imageNumber ++;
imageNumber2 ++;
checkNumber();
smallImageLoader1.source = "images/"+imageNumber+".jpg";
smallImageLoader2.source = "images/"+imageNumber2+".jpg";
}
prev_btn.addEventListener (MouseEvent.CLICK, prevImage);
function prevImage (e:MouseEvent):void {
trace("previous image");
imageNumber --;
imageNumber2 --;
checkNumber();
smallImageLoader1.source= "images/"+imageNumber+".jpg";
smallImageLoader2.source = "images/"+imageNumber2+".jpg";
}
smallImageLoader1.addEventListener (MouseEvent.CLICK, imgLoad);
function imgLoad (e:MouseEvent):void{
largeImageLoader.source = "bigimages/" +e.currentTarget.bigimage+ ".jpg";
}