Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

as3 - coding to trace needed

Options
  • 14-05-2016 1:45pm
    #1
    Registered Users Posts: 47


    i have the following code implemented and it selects a sound file out of six in an array, but i want to be able to trace the one its selected. I also want CODE to align the corresponding text question to appear in text box on stage, and then three options for answers are given (a)(b)(c).. so i need to see its all corresponding
    this is the code
    var rand = mySoundArray[Math.floor(Math.random() * mySoundArray.length)].play();
    trace ?
    Finally the text questions and answers -
    //var questions:Array=["question one sample?","question two sample? ","question three sample? ","question four sample?","question five sample?"," question six sample? "];
    //var answers:Array=[ ["answer-A","answer-B","answer-C"] ,["answer-A","answer-B","answer-C"] ["answer-A","answer-B","answer-C"],["answer-A","answer-B","answer-C"],["answer-A","answer-B","answer-C"],["answer-A","answer-B","answer-C"] ];
    // placement of correct answer in answer array above
    //q.1 = [1]
    //q.2 = [2]
    //q.3 = [1]
    //q.4 = [0]
    //q.5 = [2]
    //q.6 = [0]
    hope someone can help


Comments

  • Registered Users Posts: 778 ✭✭✭pillphil


    What's the code doing? Playing a sound file and asking a question with three possible answers? Does the order of sound files correspond with the question order?

    Store the random number in a variable and use it to access the other two arrays?


Advertisement