Like your array of name new Array("apple", "pear", "grape", "lemon") you can create an Array filled with Class objects.
Up vote 0 down vote favorite share g+ share fb share tw.
I'm making a flash quiz which will have a series of questions. Each question will have a button which will read the question out. As well as 4 buttons (probably MC's), that the user will click to answer.
Each question is a different sound clip and a different set of answers. Problem is, I need to do it dynamically so I can pick a random sound clip from the library, and 4 random buttons. One of which will be the correct answer.
So far I have manged to work out how to create dynamic instances of an object and display it in a random location: for(var i=0; I AddChild(appleMovie); } I can grab random values from an array of movieClip names like: var fruit = new Array("apple", "pear", "grape", "lemon"); var randomValue:Number = Math.random()*1; fruitrandomValue; But this doesn't seem to help when wanting different objects dynamically. Am I going about this the correct way? Should the answer buttons be movie clips that generate their own random graphic as the image?
I'm a bit lost on this one. Any help would be really appreacited. Flash actionscript-3 flash-cs4 link|improve this question asked Oct 7 '09 at 16:28whamo376 33% accept rate.
Like your array of name, new Array("apple", "pear", "grape", "lemon"); you can create an Array filled with Class objects. Var randMcs:Array=AppleMc,LemonMc,TestMc; var randomValue:Number = Math.random()*1; var randMc:Class = randMcsrandomValue as Class; var myRandMc:MovieClip=new randMc() as MovieClip; Hope it will help you!
Thats really useful thanks. Been trying to figure that one out all day. Now just gotta figure out how to score it :/ – whamo Oct 7 '09 at 17:06.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.