Skip navigation
GKelly642
Currently Being Moderated

Having a problem with sound

Apr 25, 2012 11:19 AM

The basic idea of this script is to start and stop sound using the key 'm' and the status of the sound in slot 1 (Sound in slot 1 plays all the time) but the below script won't work for some reason unknown to me but

it does work if i use two different keypresses ie 'm' and 'n' for the 2 if statements. Is there a problem with using a single key to carry out two different actions in Lingo or have i done something wrong?

 

on keyDown

  if the key = "m" and sound(1).status = 3 then

    sound(1).pause()

    sound(2).pause()

    sound(3).pause()

    sound(4).pause()

  end if

  if the key = "m" and sound(1).status = 4 then

    sound(1).play()

    sound(2).play()

    sound(3).play()

    sound(4).play()

  end if

end keyDown

 

Thanks Graham any help would be appreciated, Thanks.

 
Replies
  • Currently Being Moderated
    Apr 25, 2012 1:13 PM   in reply to GKelly642

    One little change should make it work.

     

    on keyDown

      if the key = "m" and sound(1).status = 3 then

        sound(1).pause()

        sound(2).pause()

        sound(3).pause()

        sound(4).pause()

      else if the key = "m" and sound(1).status = 4 then

        sound(1).play()

        sound(2).play()

        sound(3).play()

        sound(4).play()

      end if

    end keyDown

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 2:47 PM   in reply to GKelly642

    I think we have all been there....

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points