function AddYCoins():void
{
for (var i:int = 0; i < 10; i++)
{
var Ycoin:YCoin = new YCoin();
Ycoin.x = Math.random() * stage.stageWidth;
Ycoin.y = Math.random() * stage.stageHeight;
addChild(Ycoin);
coinsOnstage.push(Ycoin);
}
}
This function creates 10 instances of my YCoin and places it around the stage. But i wish the coins to only fall in specific areas, (i.e. i have 8 green rectangles, names area1,area2 etc) because the idea is you have to collect the coins but only staying on the green rectangles.
i knows its the stage.stageWidth i need to change but i cant think what to change it too!?
Please Help
Thanks