PDA

View Full Version : Say what you see



kekekiko
January 16th, 2007, 04:49 PM
Hi there,

was wondering if anyone could help me, I am trying to make a simple reveal game a la 'Catchphrase' whereby a picture is covered and then on a users button press a random part of the picture is revealed each time. I am skirting around trying to make it work but am sure there is a far simpler way than the one I am fidding with and I have got into a mess. The fla shows this, but it is too big to upload for some reason. Will try again at some point but in the meantime if anyone has any ideas...

hope this makes sense, those of you who have had the honour to watch roy walker and mr chips will understand!

mario_hater
January 16th, 2007, 05:20 PM
could you just make all the covering squares have a different instance name like
cover_square_1 and cover_square_2, the when the user clicks it thinks of a random number and puts it onto the end of cover_square_ and makes it invisble:

sq=0
onMouseDown=function(){
sq=random(10)
_root.square_cover_[sq]._visible=false
}

mario_hater
January 16th, 2007, 05:32 PM
40709
that works

kekekiko
January 16th, 2007, 05:54 PM
That is totally cool of you, thanks!
I will mess around with this and see what I can come up with, in gratitude here is a link to a classic clip from the show!!

http://www.youtube.com/watch?v=Izet8zN1vmE

kekekiko
January 16th, 2007, 06:28 PM
Just a quick extension, is there a quick way to add this code to a button instead of mouse down and secondly, is there a way to alter code so same square cannot be chosen twice. When it's gone, it's gone!

hope you liked clip.

mario_hater
January 18th, 2007, 12:59 PM
i don't know about the second thing but to put the code on a button, give your button an instance name of mybutton and use this code instead:

sq = 0;
mybutton.onPress = function() {
sq = random(10);
_root["box"+sq]._visible = false;
};

you could also just change the instance name in the actionscript