3 Replies Latest reply on Oct 29, 2011 9:28 AM by kglad

    how to trace a random object in an array?

    udikeren

      i have a simple array:

       

      animals = ["donkey","elephant","bird",.......];

       

      and a buttom:

      on(release){

        my_sound = new Sound();

        my_sound.attachSound(_root.animals[random (6)]);

        my_sound.start();  

       

      now i want to check which animal was chosen?

       

      if( "if for example the sound is donkey"){

      my_var=true,.

       

      what do i write in the if brackets?