Created
February 17, 2010 01:29
-
-
Save jonathantorres/306177 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function nextImage(mouseEvent:MouseEvent):void | |
{ | |
//WHEN YOU CLICK TO THE NEXT IMAGE ARROW, REMOVES THE CURRENT IMAGE, AND LOADS THE NEXT IMAGE IN THE xml.image TAG BY ADDING 1 TO THE currentImg VARIABLE, IF currentImg EQUALS THE VALUE OF lastImg IT SETS ITS VALUE TO 0 (TO GO TO THE FIRST IMAGE ON THE GALLERY (TO START OVER), ALL THIS IS DONE WITH THE CONDITIONAL. ALSO PLACES THE ARROWS IN PLACE AGAIN FOR THE NEXT IMAGE LOADED. | |
imgLoader.unload(); | |
currentImg = (currentImg < lastImg) ? currentImg + 1 : 0; | |
loadImages(); | |
arrowRightSquare.x = 20; | |
arrowRightSquare.y = imgLoader.height / 2 - 40; | |
arrowLeftSquare.x = -20; | |
arrowLeftSquare.y = imgLoader.height / 2 - 40; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment