Increment global variable on click in flash, actionscript 3
- by msandbot
Hi,
Making a flash page that can cycle through these three images on mouseclick.  For some reason the local changes to count are not reflected on the global one.  I tried _global but the syntax was odd and gave me errors.  How should I implement this?
import flash.events.Event;
var images:Array = ["images/image.jpg", "images/image2.jpg", "images/image3.jpg"];
var count:int = 0;
forward.addEventListener(MouseEvent.CLICK, loadPhoto);
function loadPhoto(evt:Event){
    if(count>2){
        count==0;
    }
    trace(count);
    imageFrame.source = images[count];
    count++;
}