At 9:42 AM -0400 5/11/04, you wrote:
I have a project with two sounds. Sound(1) is supposed to come on a few seconds before sound(2) and continue together. The direction of sound(1) is controlled by one of 5 buttons on the screen. The direction (or pan value) of sound(2) is controlled by the mouse. I want to make a record of the pan values of sound(2).

the mouseLoc varies over the width of the screen (0 -> width) pan can only be varied from -100 to 0 to + 100

you probably need to do some re-scaling to compensate
I attached this to a dummy sprite & it worked pretty well


property halfStageWidth


on enterFrame me
  ml = (the mouseLoc)[1]
  panValue = 100.0*(ml-halfStageWidth)/halfStageWidth
  -- this 'normalizes' the mouse value to be +/- 100
  sound(3).pan = panValue
end

on beginSprite me
  halfStageWidth = (the Stage).rect[3]/2

  m = member(1) -- my dummy sound member
  sound(3).play(m) -- just to kickstart the test
end


hth -Buzz


I call these within an exitFrame handler. When I try to get the pan value of sound(2) by putting it to the message window, it gives me 5, which must correspond to the number of buttons i have. When I try to call both sounds from a custom handler, I get only sound(1). I know this is an elementary question but....
Paul Schulman


[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to