Linking currentTarget to math.random
I am designing a game in which the player can travel through doors when they are the same color. There are three doors on stage:"door1","door2" and "door3". Each door is an instance of the same symbol. The symbol contains six frames, 3 copies of the door in a different color and 3 copies of the door in different colors with an icon of the player.. The frames are labeled "color1", "color2" "color3" and also "player1","player2" and "player3".
I am attempting to write code that tells Flash to a)select a door at random and then select a random frame for the
randomly selected door to set the game for play. For instance, at startup, Flash randomly selects "door2" and then
randomly selects "player2". So, the player's starting position will be on "door2" and the door will be red. After this, Flash
will select the other door colors randomly from the frames labelled "color1","color2" or "color3".
I am attempting to do this with this code:
var min:Number =1;
var max:Number =3;
("door"+String(Math.floor(Math.random()* (max - min) + min) ));
This randomly selects the door.
I would like this to randomly select the color of the randomly selected door.
(e.currentTarget).gotoAndStop("color"+String(Math.floor(Math.random() * (max - min) + min); ));
I am, of course, doing something incorrectly, but not quite sure what. I'm pretty sure currentTarget is the correct tag to use here.
