Groups | Blog | Home
all groups > flash actionscript > november 2005 >

flash actionscript : Random Button


rolorolo
11/28/2005 10:22:29 PM
Hello, On my stage I have a plain button and a dynamic text box with the
variable of 'score'. Each time the button is clicked the score goes up 7 and
one the score reaches 105 the game ends. What I need to know is how can I get
multiple buttons to ramdomly appear and dissapear on the stage? Thanks :)
timdiacon
11/28/2005 11:30:05 PM
make sure the button is set to export for actionscript in the linkage settings.

You can then make it appear and disappear using the attachmovie() function.
use random() to generate some random numbers and insert these as _x,_y values
in the attachmovie command

or you could have one function which moves it to a random position on the
stage and then a second which moves it off the stage etc.

hope that helps.
AddThis Social Bookmark Button