Hi, I’m helping my son build a simple flash game as a school project, we are trying to make a flash hidden object game. we have taken a picture of his classroom and hidden objects all around it. It’s coming out cool but we can’t figure out how to create an object count down for every time an object is found. Our code so far redirects us to a different frame when all the objects in the array are clicked but that’s about it. Can anyone please help us with this, we just need the code for a simple number count down? - This is the code that we are currently using that detects the object clicks.
import flash.display.MovieClip;
import flash.events.MouseEvent;
stop();
var _found:int = 0;
var _array:Array = [obj_1,obj_2,obj_3,obj_4];
for (var i:int = 0; i < _array.length; i++)
{
_array*.buttonMode = true;
_array*.addEventListener(MouseEvent.CLICK, objectFound);
//_array*.alpha = 0;
}
function objectFound(e:MouseEvent):void
{
var obj:MovieClip = e.currentTarget as MovieClip;
obj.removeEventListener(MouseEvent.CLICK, objectFound);
// Set the object's visibility to false
obj.visible = false;
_found++;
trace('> ' + obj.name + ': founded');
trace('> objects founded: ' + _found);
if (_found == _array.length)
{
trace('> all founded');
nextFrame();
}
}
Thank you for any help that anyone can give us, we do so appreciate it.