Join Login


professional website hosting
 Image Gallery with Next and Previous
 by nafan08 - Jan 04, 2012

Hi i followed this video on how to make an Image Gallery with Next and Previous Buttons and that all worked fine I then went to make one for my flash webpage design everything is working ok but the next and prev buttons dont work they have instance names just just wont work with the rest of my actionscript coding i done even get an error to tell why it wont work.

this is a copy of my actions scripts





import flash.events.MouseEvent;
stop()
//home button code

home_btn.addEventListener (MouseEvent.CLICK, btn1);
function btn1 (event:MouseEvent): void{
gotoAndStop (13);
}

//gallery button code

portfollio_btn.addEventListener (MouseEvent.CLICK, btn2);
function btn2 (event:MouseEvent): void{
gotoAndStop (1);

prev.addEventListener (MouseEvent.CLICK,backward);
next.addEventListener (MouseEvent.CLICK,forward);

function forward (event:MouseEvent){
if (this.currentFrame == this.totalFrames){
gotoAndStop (1);

}
else{
nextFrame();
}
}
function backward (event:MouseEvent){
if (this.currentFrame == 1){
gotoAndStop (this.totalFrames);

}
else{
prevFrame();
}
}
}

//contact button code

contact_btn.addEventListener (MouseEvent.CLICK, btn3);
function btn3 (event:MouseEvent): void{
gotoAndStop (14);
}

//about button code

about_btn.addEventListener (MouseEvent.CLICK, btn4);
function btn4 (event:MouseEvent): void{
gotoAndStop (15);
}


I hope you can help solve this.


nafan08
Australia
Posts:1
Joined:Jan 04, 2012
 RE: Image Gallery with Next and Previous
 by RiverCityGraphix - Jan 07, 2012

I would first try and remove the other code for the contact and about buttons. If it works with that removed then you will know that those were the issue.

Also, try removing the space in your gotoAndStop functions. It should be gotoAndStop(14); rather than gotoAndStop (14); for instance.

Lastly, make sure this is AS3 and not AS2 otherwise it wont work at all.


Be sure to subscribe on YouTube.

Do you take great photos? Consider selling them on Dreamstime.
RiverCityGraphix
United States
Posts:327
Joined:Nov 21, 2009
  
Home About Contact Forum Youtube Privacy Policy
Copyright © 2009-2011 RiverCityGraphix.All Rights Reserved.