21 Replies Latest reply on May 5, 2006 8:44 AM by Newsgroup_User

    Very Strange Sound Issue

    SebastianStatic
      on mouseDown me
      sound(2).play(castLib("Interface").member["touchPanel"])
      end

      Hi guys, that is the *only* code I have in a click sound handler script. I've attached it to multiple sprites all over the stage and for some kooky reason it plays the sound twice every 4 clicks. It doesn't matter what you're clicking on, every 4th click without fail it will queue the sound up twice and play it. Anyone got any idea what the hell would be causing it because something so simple is bugging me so chronically.

      Cheer, Sebastian
        • 1. Re: Very Strange Sound Issue
          Level 7
          I hvene't seen that syntax before

          on mouseDown me
          sound(2).play(castLib("Interface").member)
          end


          maybe try:

          sound(2).play(member("sndName", "Interface") )
          • 2. Re: Very Strange Sound Issue
            Level 7
            On Thu, 20 Apr 2006 01:53:17 GMT, JB posted in macromedia.director.basics:

            > I hvene't seen that syntax before

            JB, it's just another instance of the Web forum posting garbage to the news
            server. What we see is not what they post.

            <rant>
            IMO, questions with code posted by anybody at webforumsuser@macromedia.com
            are just not worth responding to anymore. Why take the time to try to help
            with code that is posted inaccurately?

            I just can't imagine what went through their heads when they decided to use
            forum software that garbles code - in newsgroups that are about code! It's
            not just Director - all their scripting newsgroups have this trouble.

            What will Adobe do about it? Who knows. They're even more in love with Web
            forums that post to NNTP servers than MM was.
            </rant>


            --
            Mark "Fading Away" Boyd
            Keep-On-Learnin'
            • 3. Re: Very Strange Sound Issue
              SebastianStatic Level 1
              Sooooo... Bad forum software aside, has anyone experienced this issue before or know what would be causing it? If the code itself was to fire off twice on the one mouseDown would it queue the sound? I ask this because at some points I have overlapping sprites that may both be triggering the event. I've attached the code itself using the "attach code" button on the forum so hopefully the forum doesn't go breaking it on the way to the newsgroup.
              • 4. Re: Very Strange Sound Issue
                Level 7
                On Thu, 20 Apr 2006 23:14:10 GMT, SebastianStatic posted in
                macromedia.director.basics:

                > Sooooo... Bad forum software aside, has anyone experienced this issue
                > before or know what would be causing it? If the code itself was to fire
                > off twice on the one mouseDown would it queue the sound? I ask this
                > because at some points I have overlapping sprites that may both be
                > triggering the event. I've attached the code itself using the "attach
                > code" button on the forum so hopefully the forum doesn't go breaking it
                > on the way to the newsgroup.

                Hey! I can see it

                Any chance one or more of those sprites have two copies of the behavior?
                More remote, but any chance there's a movie script with a mouseDown event
                that plays that sound?

                > on mouseDown me
                > sound(2).play(castLib("Interface").member["touchPanel"])
                > end

                That does seem to be off a bit. I can't test in Director right now, but I
                suspect JB was right.

                on mouseDown me
                sound(2).play(member("touchPanel", "interface"))
                end

                Which still wouldn't explain double play every 4 clicks or so. And with
                overlapping sprites, the one in the highest channel traps the event, so I
                don't think that would do it.

                Have you tested it in a simple, bare-bones movie?



                --
                Mark A. Boyd
                Keep-On-Learnin'
                • 5. Re: Very Strange Sound Issue
                  Level 7
                  Mark A. Boyd wrote:
                  > <rant>
                  > IMO, questions with code posted by anybody at
                  > webforumsuser@macromedia.com are just not worth responding to
                  > anymore. Why take the time to try to help with code that is posted
                  > inaccurately?
                  >
                  > I just can't imagine what went through their heads when they decided
                  > to use forum software that garbles code - in newsgroups that are
                  > about code! It's not just Director - all their scripting newsgroups
                  > have this trouble.
                  >
                  > What will Adobe do about it? Who knows. They're even more in love
                  > with Web forums that post to NNTP servers than MM was.
                  > </rant>

                  If you wanted to write an open letter to them explaining the situation, I
                  would be happy to add my name to it; perhaps some of the other "regulars"
                  here would as well. My eloquence ran off with my patience over waiting for
                  them to fix it.
                  webforumsuser at macromedia . com has met Mr. Killfile on my computer.

                  "Web Forums: Ignoring twenty years of work":-
                  http://www.highprogrammer.com/alan/rants/webforums.html

                  Andrew


                  • 6. Re: Very Strange Sound Issue
                    Level 7
                    Andrew Morton wrote:

                    > If you wanted to write an open letter to them explaining the situation, I
                    > would be happy to add my name to it; perhaps some of the other "regulars"
                    > here would as well.

                    If a petition type letter is written, I'd be happy to be included. Keep me
                    posted at d.utian@unsw.edu.au.

                    regards
                    Dean

                    Director Lecturer / Consultant
                    http://www.fbe.unsw.edu.au/learning/director
                    http://www.multimediacreative.com.au




                    • 7. Re: Very Strange Sound Issue
                      Level 7
                      Hi Sebastian,

                      First on the syntax side, you could use:
                      sound(2).play(member("touchPanel"))
                      There shouldn't be a need to specify the castLib, unless your have given multiple
                      sound cast members the same name, which is a BAD idea.

                      I still use the following to play sound
                      puppertSound 2, "touchPanel"
                      I don't see 'puppetSound' in the Director Docs so maybe it's being phased out.

                      regards
                      Dean

                      Director Lecturer / Consultant
                      http://www.fbe.unsw.edu.au/learning/director
                      http://www.multimediacreative.com.au


                      • 8. Re: Very Strange Sound Issue
                        SebastianStatic Level 1
                        Thanks for the replies and the de-railment of topic guys but you are all *really* missing the point. My code already plays the sound. I'm not really looking for other possible syntax combinations nor lectures on naming conventions, i'm really just looking to find out if anyone has experienced this strange behaviour before, and if so, what was causing it.
                        • 9. Re: Very Strange Sound Issue
                          Level 7
                          Thanks for the replies and the de-railment of topic guys but you are all
                          *really* missing the point. My code already plays the sound. I'm not really
                          looking for other possible syntax combinations nor lectures on naming
                          conventions, i'm really just looking to find out if anyone has experienced this
                          strange behaviour before, and if so, what was causing it.

                          • 10. Re: Very Strange Sound Issue
                            Level 7
                            SebastianStatic wrote:

                            > Thanks for the replies and the de-railment of topic guys but you are all
                            > *really* missing the point. My code already plays the sound. I'm not really
                            > looking for other possible syntax combinations nor lectures on naming
                            > conventions, i'm really just looking to find out if anyone has experienced this
                            > strange behaviour before, and if so, what was causing it.

                            Sebastian,

                            Testing is often just a process of elimination - going through all possible causes
                            and checking if the problem goes away if you do something differently. So, while
                            the syntax may not have been the cause of your problem, it is still worth looking
                            at.

                            The answer to your question, 'has anyone experienced this problem', may be 'no'.
                            However, we have still made an effort to guide you in the right direction to help
                            find the cause of the problem as well as code in the best way to avoid other
                            problems.

                            regards
                            Dean

                            Director Lecturer / Consultant
                            http://www.fbe.unsw.edu.au/learning/director
                            http://www.multimediacreative.com.au


                            • 11. Re: Very Strange Sound Issue
                              Level 7
                              On Sat, 22 Apr 2006 03:17:16 GMT, Dean Utian posted in
                              macromedia.director.basics:

                              > Andrew Morton wrote:
                              >
                              >> If you wanted to write an open letter to them explaining the situation, I
                              >> would be happy to add my name to it; perhaps some of the other "regulars"
                              >> here would as well.
                              >
                              > If a petition type letter is written, I'd be happy to be included. Keep me
                              > posted at d.utian@unsw.edu.au.
                              >

                              I'm probably not the best man to author this letter as my business writing
                              skills leave a lot to be desired. I would be happy to sign as well, though.

                              If anybody does write this letter, I bet there would be a lot of people on
                              the flash.actionscript newsgroup willing to join in as well.

                              I don't really know anybody over there as I just skim through it from time to
                              time (too may identical questions for me to read on a regular basis).


                              --
                              Mark "Passing the Baton" Boyd
                              Keep-On-Learnin'
                              • 12. Re: Very Strange Sound Issue
                                Level 7
                                On Sat, 22 Apr 2006 08:12:16 GMT, SebastianStatic posted in
                                macromedia.director.basics:

                                > Thanks for the replies and the de-railment of topic guys but you are all
                                > *really* missing the point.

                                Sorry about that. FWIW, if you use a newsreader instead of the Web forum, it
                                is very easy to see how the "de-railment" splits into separate strands of the
                                thread. No need to read the strand you're not interested in.

                                > My code already plays the sound. I'm not
                                > really looking for other possible syntax combinations nor lectures on
                                > naming conventions, i'm really just looking to find out if anyone has
                                > experienced this strange behaviour before, and if so, what was causing
                                > it.

                                Just because the sound plays, does not mean that incorrect syntax isn't the
                                cause.

                                You may have discovered a quirk in Director. Your first guess about the queue
                                just might hold some weight. Who knows, Director may see that syntax and is
                                attempting to queue the sound. I can't test that theory since the code
                                produces a script error in D8.5.1.

                                If you replace member "touchPanel" with a longer sound (I'm guessing that's
                                just a very short sound effect), do you see the queue stacking up in the
                                Watcher window?

                                Do you still have the problem if you use the correct syntax?

                                Have you checked out any of my other ideas?


                                --
                                Mark A. Boyd
                                Keep-On-Learnin'
                                • 13. Re: Very Strange Sound Issue
                                  Level 7


                                  "Mark A. Boyd" wrote:

                                  > I'm probably not the best man to author this letter as my business writing
                                  > skills leave a lot to be desired. I would be happy to sign as well, though.
                                  >
                                  > If anybody does write this letter, I bet there would be a lot of people on
                                  > the flash.actionscript newsgroup willing to join in as well.
                                  >

                                  Mark,

                                  I'm happy to write the letter. Do you want to contact me offlist -
                                  d.utian@unsw.edu.au

                                  regards
                                  Dean

                                  Director Lecturer / Consultant
                                  http://www.fbe.unsw.edu.au/learning/director
                                  http://www.multimediacreative.com.au


                                  • 14. Re: Very Strange Sound Issue
                                    Level 7


                                    "Mark A. Boyd" wrote:

                                    > I can't test that theory since the code produces a script error in D8.5.1.

                                    I just tested the
                                    sound(2).play(castLib("Interface").member("touchPanel"))
                                    and got an error message

                                    then tried
                                    sound(2).play(castLib("Interface").member["touchPanel"])
                                    and it worked.
                                    Note the difference is the [ ] brackets.

                                    regards
                                    Dean

                                    Director Lecturer / Consultant
                                    http://www.fbe.unsw.edu.au/learning/director
                                    http://www.multimediacreative.com.au



                                    • 15. Re: Very Strange Sound Issue
                                      Level 7
                                      Dean Utian wrote:

                                      > I just tested the
                                      > sound(2).play(castLib("Interface").member("touchPanel"))
                                      > and got an error message
                                      >
                                      > then tried
                                      > sound(2).play(castLib("Interface").member["touchPanel"])
                                      > and it worked.
                                      > Note the difference is the [ ] brackets.

                                      Continued testing (MX 2004 by the way). Tried the:syntax of
                                      sound(2).play(member("touchPanel", "interface"))
                                      that worked fine.

                                      So far, haven't been able to get the sound to repeat after 4 clicks.

                                      Sebastian, if you're still reading - try import a different sound member and see
                                      if that makes a difference. I tested with a couple of sounds, one less than a
                                      second, the other about 1.5 seconds.

                                      regards
                                      Dean

                                      Director Lecturer / Consultant
                                      http://www.fbe.unsw.edu.au/learning/director
                                      http://www.multimediacreative.com.au


                                      • 16. Re: Very Strange Sound Issue
                                        Level 7
                                        On Sat, 22 Apr 2006 16:16:26 GMT, Dean Utian posted in
                                        macromedia.director.basics:

                                        > then tried
                                        > sound(2).play(castLib("Interface").member["touchPanel"])
                                        > and it worked.
                                        > Note the difference is the [ ] brackets.

                                        Yes, and that's what Sebastian is using as well. I suspect that may be part
                                        of the newer object model syntax since it still errors out in D8.5.1.

                                        Do you see the sound getting added to the queue?


                                        --
                                        Mark A. Boyd
                                        Keep-On-Learnin'
                                        • 17. Re: Very Strange Sound Issue
                                          Level 7
                                          On Sat, 22 Apr 2006 16:02:43 GMT, Dean Utian posted in
                                          macromedia.director.basics:

                                          > "Mark A. Boyd" wrote:
                                          >
                                          >> I'm probably not the best man to author this letter as my business
                                          >> writing skills leave a lot to be desired. I would be happy to sign as
                                          >> well, though.
                                          >>
                                          >> If anybody does write this letter, I bet there would be a lot of people
                                          >> on the flash.actionscript newsgroup willing to join in as well.
                                          >
                                          > Mark,
                                          >
                                          > I'm happy to write the letter. Do you want to contact me offlist -
                                          > d.utian@<snip>.au

                                          Done.

                                          Anybody wanting to contact me can just replace the Dot in my address with a .
                                          and remove anything else that looks invalid.


                                          --
                                          Mark A. Boyd
                                          Keep-On-Learnin'
                                          • 18. Re: Very Strange Sound Issue
                                            Level 7

                                            "Mark A. Boyd" wrote:

                                            > > Note the difference is the [ ] brackets.
                                            >
                                            > Yes, and that's what Sebastian is using as well. I suspect that may be part
                                            > of the newer object model syntax since it still errors out in D8.5.1

                                            In the MX2004 Docs, I see under the 'member' property, the example is given as:
                                            myMember = castLib("Internal").member[2]
                                            So guess that means Sebastian's verison below does follow the new model, even
                                            though it looks strange:
                                            castLib("Interface").member["touchPanel"]

                                            > Do you see the sound getting added to the queue?

                                            I watched the 'sound(2).getPlayList()' in Object Inspector (no Watcher Window
                                            in MX 2004) and did not see the sound getting added to a queue just using
                                            'play'. In fact 'play' just clears the queue list.

                                            Testing the following in the Message Window:
                                            sound(2).queue(castLib("Interface").member["touchPanel"])
                                            sound(2).queue(castLib("Interface").member["touchPanel"])
                                            sound(2).play()

                                            Result: sound plays twice.

                                            So, can't see why Sebastian should be getting the repeating sound simply using
                                            the behavior he typed. It really needs to be tested in a 'bare bones' movie and
                                            with other sounds.

                                            regards
                                            Dean

                                            Director Lecturer / Consultant
                                            http://www.fbe.unsw.edu.au/learning/director
                                            http://www.multimediacreative.com.au



                                            • 19. Re: Very Strange Sound Issue
                                              Level 7
                                              On Mon, 24 Apr 2006 15:51:54 GMT, Dean Utian posted in
                                              macromedia.director.basics:

                                              > So, can't see why Sebastian should be getting the repeating sound simply
                                              > using the behavior he typed. It really needs to be tested in a 'bare
                                              > bones' movie and with other sounds.

                                              Thanks for confirming that and that the syntax is correct in MX2004.

                                              Nothing heard from him since his "de-railment" message.

                                              Here's hoping he got things worked out and didn't get put off by my rant.


                                              --
                                              Mark A. Boyd
                                              Keep-On-Learnin'
                                              • 20. Re: Very Strange Sound Issue
                                                SebastianStatic Level 1
                                                OK guys, thanks for all the effort and interest in this thread. I managed to get some time to focus on fixing the sound issue (it's been on the backburner until recently as things have been hectic).

                                                I created a new director file with a single sprite, single sound and single behaviour using a few of the varying synataxes (syntaxii?) that were given here all to no avail. I then tried a different sound effect, one of the standard Windows ones and it worked perfectly. This narrowed it down to the sound effect for me. I then went and grabbed a sound editing program and tried re-exporting with multiple different formats/bitrates/channel depths again, to no avail.

                                                I then noticed that the length of the sound effect itself was rather short (0.08 seconds) as it was just a click noise. This got me thinking that it might be something to do with Director reading and writing to the sound card memory buffer thingo so I extended the sound with 1s of silence and voila, no more double dings on every 4th click.

                                                I'd like to report this as a bug to Macromedia if possible, does anyone know the correct medium for doing so? Is there a bugtracker of some kind for Macromedia products?

                                                Thanks to everyone for their suggestions and support.
                                                • 21. Re: Very Strange Sound Issue
                                                  Level 7
                                                  On Thu, 04 May 2006 00:36:19 GMT, SebastianStatic posted in
                                                  macromedia.director.basics:

                                                  > I'd like to report this as a bug to Macromedia if possible, does anyone
                                                  > know the correct medium for doing so? Is there a bugtracker of some
                                                  > kind for Macromedia products?

                                                  Hi Sebastian,

                                                  The link to the Feature Request/Bug report is

                                                  http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=11

                                                  You might also see if it's already on the Quirkslist at www.updatestage.com.
                                                  If not, submit it and your work-around there as well. If Gretchen can
                                                  duplicate the symptom she'll add it to the list.



                                                  --
                                                  Mark A. Boyd
                                                  Keep-On-Learnin'