4 Replies Latest reply on Oct 16, 2008 10:56 PM by Ekipah

    How to play music when clicking a button?

    Ekipah
      Hello There

      Could someone help me a bit to get started?
      My first attempt is to just create a scene, in which clicking a button it starts to play a mp3 file. I did get it to start it to play as a backround music after reading the help file, and tried also find source code from internet and also here without success.

      So, could someone be so kind to give me a Lingo example code snipplet, which would start playing the music immediately without first importing the file (like streaming the file) if this is possible and also small instructions how to assign it to the button (so, not as a backround music).

      I just got the Adobe Director 11 couple of days ago, and my wife is starting to get angry for me for sitting with my NB all the evenings without any progress,,,

      Thanks, in case someone answers…

        • 1. Re: How to play music when clicking a button?
          Level 7
          Any code provided will depend on where your sound file is.

          Is it imported into a cast library, or is it an external file?

          If it's an external file, do you need to give the user the option to
          choose a file from a list (or even a different directory), or will the
          sound file to be played always exist in the same (relative) directory
          with the same name?
          • 2. Re: How to play music when clicking a button?
            James Newton, ACP Level 3
            Here's a demo movie: <nonlinear.openspark.com>. You can download the source from here.

            It uses a ShockWave Audio (SWA) member, which links to an external file.
            • 3. Re: How to play music when clicking a button?
              Ekipah Level 1
              Thanks Sean, here is some more info for your answer:

              Is it imported into a cast library, or is it an external file?

              I did try it to get working with an imported mp3 file and also I would like to add fuctionality to use it as a link.

              If it's an external file, do you need to give the user the option to
              choose a file from a list (or even a different directory), or will the
              sound file to be played always exist in the same (relative) directory
              with the same name?

              The best would be a possibility to choose the file, and if it's possible to set up a starting directory (like "My Documents\My Music" for example), so that could work as a mp3 player.
              • 4. Re: How to play music when clicking a button?
                Ekipah Level 1
                Thanks for the code openspark.

                I'll try with this one. I tried to find a simple getting started tutorial with Button & Lingo scripting, but could not find any.

                Any ideas where this kind could be?

                In case startiong with the Directors Help seems to take time, and my wife is getting more and more angry to me even beer looks like not to help...