Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

as3 - coding to trace needed

  • 14-05-2016 01:45PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 793 ✭✭✭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