XML gallery and other questions
hello everyone,
beginner when comes flash, actionscript, , forth. started reading on subjects several months ago, when decided website needed serious upgrade, , thought flash best way achieve wanted. i've looked @ number of websites, , have done best figure things out on own, i've reached point i'm not sure how proceed , appreciate , guidance of knows they're doing.
keeping inexperience in mind, i'll best accurately describe problems i'm having.
1. have gallery based on code tutorial on this site, expand in several ways - first being, divide gallery multiple pages, pull thumbnails single xml file. right have 8 thumbnails per page, each page being separate xml - doesn't seem efficient when want update gallery. best way tell flash load first 8 images xml, next 8 when button clicked, , forth?
2. allow user cycle through full sized images - is, when user viewing full image, can click button go forward or backward next full-sized image without having exit , go gallery.
3. lastly, want full sized images resized , repositioned based on size of browser window. right now, images appear scaled , positioned when first click on them, if resize window while large image up, doesn't update it's size or position. copied initial code using determine size/position calling function within function. needless say, seems bad way of doing things, i'm not sure else how work way want it.
in advance help!
to display 8 images per page, can consider 2 variables...one index , display 8 in page follows:
var index:int = 0;
var imagestodisplay:int = 8;
var imagescount:int = 8;
function arrangeimages()
{
for(var i:int = index;i < imagescount;i++)
{
//code loading , displaying images here...
}
}
next_btn.addeventlistener(mouseevent.click,gotonextpage); //next_btn button go next page , display next 8 images...
prev_btn.addeventlistener(mouseevent.click,gotoprevpage); //prev_btn button go last page , display previous 8 images....
function gotonextpage(e:mouseevent):void
{
if(index <= length of images - imagestodisplay)
{
index += imagestodisplay;
imagescount += imagestodisplay;
arrangeimages();
}
}
function gotoprevpage(e:mouseevent):void
{
if(index >= imagestodisplay)
{
index -= imagestodisplay;
imagescount -= imagestodisplay;
arrangeimages();
}
}
for viewing full size images of gallery 1 one, need take next , previous buttons. @ time have images of current page checking xml well. use code above difference need consider index of 8 images , thier length nothing 8. prev button
if(index > 0)
index--;
call function loads images...
for next button
if(index < 7)
index++;
call function loads images...
for placing images constantly, can take 1 movieclip have these images. place movieclip according stage.
mc.x = stage.stagewidth/ 2;
like that....
note: want provide basic idea. may not exact code. per requirements, can change...and go on...
More discussions in ActionScript 3
adobe
Comments
Post a Comment