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++;
}
A simplified version of the problem would be getting trace to output the number of times you've clicked.
import flash.events.Event;
var count:int = 0;
forward.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(evt:Event)
{
trace(count);
count++;
}