Hi I am wondering if someone can help me.
I am basically trying to make a quiz.
I basically want to add two movie clips to the stage randomly.
When the button play is clicked it generates two movie clips which represent two numbers, they then have to work out what the answer is.
At the moment i have this code but i cant work out how i can randomly add them to the stage.
Code:import flash.events.MouseEvent; stop(); btnNumericHelp.addEventListener(MouseEvent.CLICK, onButtonClick3); btnPlay.addEventListener(MouseEvent.CLICK,onButtonClick5); function onButtonClick3 (event:MouseEvent): void { gotoAndPlay(1,"Scene 4"); } function onButtonClick5 (event:MouseEvent):void { trace ("Pressed"); for (var i:int = 0; i < 10; i++) { var Beer:MovieClip = new BeerMC(); Beer.name = "Beer" + i; trace (Beer.name); var Cocktail:MovieClip = new CocktailMC(); Cocktail.name = "Cocktail" + i; trace (Cocktail.name); } }




Reply With Quote