0

I'm making a video game-like project with Flash Builder (Flex if you wish).

I have an array of movieclips (which are SWCs that I've called from Flash). These movieclips are separate actions of the character in the game, which are going to be "liked" or "disliked" by the player.

Each movieclip will have their own parameters, which will get positive values if the "like" button is clicked, or negative values if the "dislike" button is clicked by the player (the buttons are in a different class by the way). Not sure how to write this code.

Also, I would like to call the movieclips on stage in an order (or let's say frequency) according to their parameters. The higher their likes are, the more they will show up on stage; the higher their dislikes are, the less they will show up on stage. I really have no idea how to write this one.

Could you please help me?

1 Answers1

0

Math.random() will give you a percentage (basically some fraction between 0 and 1). If you multiply that by some number based on likes/dislikes, then you can get a probability that will still be sort of random, but will be higher based on the likes/dislikes. You'll probably need to experiment with it to find some threshold which is the minimum that will need to be met for something to be shown based on the real needs of your project.

MPO is that it's rude to downvote a question before giving the original poster a chance to respond to negative feedback.

Amy Blankenship
  • 6,485
  • 2
  • 22
  • 45