How do I put an answer in a randon position in a math game?

I have a math game I'm working on and I would like to have the answers appear in random positions. For example:
3 x 11 = ?
9    0    33
The answer is obviously 33, position 3. Right now the answer will appear in position 3 every time.
In the next problem I don't want the answer to appear in the same position. I want it to appear in another position randomly. So for example the next problem will have the answer in position 1:
3 x 4 = ?
12    14     73
I am currently putting the answers in a dynamic text box that is already on the stage. I thought about using an array but I can't figure that part out.
Example screen shot:

if you have 3 textfields (eg, tf1,tf2,tf3) for the answers, you could use:
var answersA:Array=[[x11,x12,x13],...,[9,0,33],...,[xn1,xn2,xn3]];
where the 3 answer choices for question 1 is x11,x12,x13 and the 3 answer choices for the nth question is xn1,xn2,xn3
you could use:
function displayAnswersF(i:int):void{
// display answers for the ith question
var answerA:Array = answersA[i];
answerA.shuffle();
tf1.text=answerA[0].toString();
tf2.text=answerA[1].toString();
tf3.text=answerA[2].toString();
function shuffle(a:Array) {
    var p:int;
    var t:*;
    var ivar:int;
    for (ivar = a.length-1; ivar>=0; ivar--) {
        p=Math.floor((ivar+1)*Math.random());
        t = a[ivar];
        a[ivar] = a[p];
        a[p] = t;

Similar Messages

  • How do I put a "close file" icon in the toolbar? I've searched for an hour to find the answer with no luck?

    How do I put a "close file" icon in the toolbar? There's an "open file" icon by default, but I cannot -- in spite of searching for an hour--find a way to put a "close file" icon in there?

    Toolbar where? What program? What system?
    Mylenium

  • TS1424 How do u find the answers to your security questions cause I have forgot what I put ?

    I put money on my phone with a iTunes card... Once I sighed in it ask security questions like who was your best childhood friend?!? I put everyone I ran with and none are correct.. So how can I change those answers or get the answers I used..

    Welcome to the Apple community.
    Contact Apple through iTunes Store Support

  • How can i put apps from one ipod to a new ipod?

    how can i put apps from one ipod to a new ipod?

    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

  • Ok, I have two itunes library account one for the PC and one for my Mac, I have my first iphone on my PC, but i just upgrade and I would like to use my new iphone on my Mac but all of my apps and other stuff is in the first library.. How do I put my apps

    ok, I have two itunes librarys account, one for my PC and one for my Mac, I use the PC for my iphone, but I upgrade my iphone and all my apps and
    stuff is on the first itunes library. How do I put the apps from one iphone to the otherusing two dirffernt itunes library? please help..

    Drrhythm2 wrote:
    What's the best solution for this? I
    Copy the entire /Music/iTunes/ folder from her old compouter to /Music/ in her account on this new computer.

  • How do I put these songs and videos onto the Music App?

    How do I load mp3 content, videos, and other content from applications onto the music app? For example, I have applications such as Video Hunter Pro that downloads youtube videos, but how do I put the videos or audio track into my Music app? I don't want to constantly switch apps. For iTunes on all devices.

    Only items directly downloaded from iTunes Store or synced over from iTunes on a computer can be placed in the music or video app.

  • I recently sync one song to my friends iphone 4 and it erased all the music and only put that one song. I tried backing it up but it didnt help. How do I put all previous music back on the iphone?

    I recently sync one song to my friends iphone 4 and it erased all the music and only put that one song. I tried backing it up but it didnt help. How do I put all previous music back on the iphone?

    Re- sync the phone with the computer it was originally synced with.

  • How do I put text into an Edge File that clients can edit easily afterwards

    Hi
    Can anyone explain how I can put text into an edge file (styled with google fonts) and make it so that clients can access the text and update the text as they require?
    Previous suggestion was dynamically loading a .txt file - any instructions would be most appreciated.
    Thanks.

    Hi Resdesign!
    Your code is very useful to learn how to use Json in Adobe Edge Animate!
    But I have a question: why you use ( i ) as argument of the function UpdateInfo and when you recall it you use ( index )?
    $.getJSON('slides.json', function(data){
              //for(var i=0; i<data.length; i++){
    function updateInfo(i){
                        sym.$("photo").css({"background-image": "url('"+data[i].image+"')"});
                        sym.$("pillar").html(data[i].pillar);
                        sym.$("what").html(data[i].what);
                        // position
              index = -1;
              sym.$("btn").click(function(){
              index++;
                        if (index>=5){
                                  index = 0;
              updateInfo(index);
    Many thanks for your attention!
    Davide

  • How do you put edge animation in Magento?

    How do  you put edge animation in Magento please?

    Provide the name of the program you are using so a Moderator may move this message to the correct program forum
    This Cloud forum is not about help with program problems... a program would be Photoshop or Lighroom or Muse or ???

  • How do you put safari web pages into icloud with the safari iCloud button?

    how do you put safari web pages into icloud with the safari iCloud button?

    What that button does is sync your tabs between your devices. So if you have multiple macs with Mountain Lion and/or devices with iOS 6 (once it comes out this fall) you can pick up where you left off. For example, let's say I have apple.com, nytimes.com, and facebook.com open on my mac, but I need to run. Later, if I need to use another computer in my household, I can just restore the tabs that I was using before on this other mac.

  • How do I put an external display to sleep when I am using my MacBook Air for presentation?

    How do I put an external display to sleep when I am using my MacBook Air for presentation? I do not want to go to the projector just to turn it off and turn on again after a while? Is there a keyboard shortcut for that?

    I want to be able to sleep the external display and at the same time do things in the MacBook.( This feature is useful for me so that I can prepare some things and so that my audience will not see what I am about to show them.)
    Is there a feature for Mountain Lion?

  • How do i put a music icon on my iphone

    how do i put a music icone on my iphone

    Are you asking about a music icon instead of an "iPod" icon?
    If so, you need only to upgrade your iOS software.
    In iOS 5 Apple renamed iPod to music and in addition created a separate "videos" app, making iPhone consistent with iPod Touch and iPad devices.

  • How can I put my icloud photos to camera roll or photo stream?

    I got a nee iphone, i backed up everything and restored it into mu new iphone, but the pictures didn't restore so i did it manually but now on my phone i got different albums icloud photo stream and camera roll. How can i put the icloud picture into camera roll or photo stream. Any ideas?? On my old iphone ive deleted everything.

    Hello Ozzie94,
    Thanks for the additional information. The camera roll is designed for photos taken on your device, or saved images from Mail and other applications. Photos synced from a computer are organized into their own album(s):
    View photos and videos - iPhone
    http://help.apple.com/iphone/7/#/iph3d267610
    - Camera Roll—photos and videos you took on iPhone, or saved from an email, text message, webpage, or screenshot
    - Shared photos and videos—Photos and videos that you’ve shared with iCloud Photo Sharing or that others have shared with you (see iCloud Photo Sharing)
    - Photos and videos synced from your computer (see Sync with iTunes)
    Additionally, you may find more information by using another one of Apple's support resources - https://getsupport.apple.com
    Thanks,
    Matt M.

  • How do I put the music on my IPod onto the ITunes on my new computer? Help

    Just got a new computer. How do I put the music, ect. on my IPod onto the ITunes on the new computer?
    I downloaded ITunes onto the new computer, plugged in my Ipod, and a box popped up asking to either erase or transfer what was on my Ipod. I'd read before we put up the new computer that all you have to do is click the Transfer button and it will put all the music, ect. onto the ITunes account. Well, it didn't work. The page where it shows the bar that shows the memory is on the ITunes and shows exactly what it did on the old computer, but that's it. There's no music, nothing. I logged on to my ITunes account, that did nothing. What can I do? There has to be SOMETHING. Thanks so much!
    Message was edited by: tbatt

    1). Connect your iPod to your new computer. When you get the message that it is linked to a different library and asking if you want to link to this one and replace all your songs etc, press "Cancel". Pressing "Erase and Sync" will irretrievably remove all the songs from your iPod.
    2). When your iPod appears in the iTunes source list change the update setting to manual, that will let you continue to use your iPod without the risk of accidentally erasing it. Check the "manually manage music and videos" box in Summary then press the Apply button. Also when using most of the utilities listed below your iPod needs to be enabled for disc use, changing to manual update will do this by default: Managing content manually on iPod and iPhone
    3). Once you are connected and your iPod is safely in manual mode there are a few things you can do to restore your iTunes from the iPod. iTunes will only let you copy your iTunes Store purchases directly from an iPod to the computer, you'll find details in this article: Copying iTunes Store purchases from your iPod or iPhone to a computer
    For everything else (music from CDs, other downloads and including iTunes purchased songs and in some cases, videos and games) there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod. You'll find that they have varying degrees of functionality and some will transfer movies, videos, photos, podcasts and games as well. You can read reviews and comparisons of some of them here:
    Wired News - Rescue Your Stranded Tunes
    Comparison of iPod managers
    A selection of iPod to iTunes utilities:
    TuneJack Windows Only (iPhone and iPod Touch compatible)
    SharePod Windows Only (iPhone and iPod Touch compatible)
    iPod2PC Windows Only
    iDump Windows Only
    YamiPod Mac and Windows
    iPod Music Liberator Mac & Windows
    Floola Mac & Windows
    iPodRip Mac & Windows (iPhone and iPod Touch compatible)
    iPod Music Liberator Mac & Windows (iPhone and iPod Touch compatible)
    Music Rescue Mac & Windows (iPhone and iPod Touch compatible)
    iGadget Mac & Windows (iPhone and iPod Touch compatible)
    iRepo Mac & Windows (iPhone and iPod Touch compatible)
    iPod Access Mac & Windows (iPhone and iPod Touch compatible)
    TouchCopy Mac & Windows (iPhone and iPod Touch compatible)
    There's also a manual method of copying songs from your iPod to a Mac or PC. The procedure is a bit involved and won't recover playlists but if you're interested it's available on page 2 at this link: Copying Content from your iPod to your Computer - The Definitive Guide
    4). Whichever of these retrieval methods you choose, keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync.
    5). I would also advise that you get yourself an external hard drive and back your stuff up, relying on an iPod as your sole backup is not a good idea and external drives are comparatively inexpensive these days, you can get loads of storage for a reasonable outlay: Back up your iTunes library by copying to an external hard drive

  • How do i put creative cloud on another computer

    How do I put creative cloud on another computer

    Davidm29914240 for information on how install the Adobe Creative applications included with your membership please see Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html.

Maybe you are looking for

  • Error while installing Oracle identity Management Suite 11.1.1.2.0.

    Hi, I am installing Oracle Identity Federation in that i am getting following issue while configuring the tools in Oracle Identity Management Suite 11.1.1.2.0. "Error Starting Managed Server wls_oif1. Cause: An internal error has occured : Managed Se

  • Migration from 8.1.7/ windows2000  to 10g/linux

    what is the step by step procedure to take export from 8.1.7 / windows 2000 and import into 10g / centos( linux). option 1: First upgrade from 8.1.7 / windows 2000 server to 10g / windows 2000 server and then 10g / windows 2000 server to 10g/ linux.

  • FB 4.5 is buggy

    I need to get this of my chest. I'm working on my first big FB project. Multiple multitouch AIR apps with pc's communicating in a network with each other and even vending machines. Is going to be a nice showcase for Adobe when I get this working. To

  • How to wirte condition

    Hi   Plz advice me how to write a simple  if condition here. when source element A = 1...then  I need to send 10 into target element when source element A = 4 ... then I need to send 4 into same traget element. regards, Ansar.

  • Trying to do routine update to itunes and wont finish says something about a network issue

    trying to download update 11.1.4 onto my Ipod touch, and it gets so far and then I get a message saying: The feature you are trying to use is on a network resource that is unavailable. I havent changed anything since my last update.