1 Reply Latest reply on Dec 28, 2006 7:58 PM by kdock

    More on External Sound Files

    kdock Level 1
      <<Heavy Sigh>>

      I'm using Flash 8 Pro and created a slide presentation. The top slide has common elements, including audio file control buttons. Each of the content slides has an external audio file associated with it, which the viewer can play by clicking the "play" button. The slide and the file have the same name so the "play" ActionScript can determine the currentSlide._name, add ".mp3" to the end of it and play it. Other buttons on this slide do work in the browser -- the ones that move the viewer from slide to slide and back. When I take a look at the variables, they are all reported like this: "_level0.Characters.Flotsam_Jetsam".

      Unfortunately, it works flawlessly in the Flash preview, but does not work in Dreamweaver (local) preview, or when published to the web. Here is the code I'm using for the play button -- as you can see, I took the advice of the previous thread and added "this" in parentheses after "new Sound" --

      on (release) {
      // create a new Sound object
      var my_sound:Sound = new Sound(this);
      var my_slide = currentSlide._name;
      // if the sound loads, play it; if not, trace failure loading
      my_sound.onLoad = function(success:Boolean) {
      if(success) {
      my_sound.start();
      trace("Sound loaded");
      } else {
      trace("Sound failed");
      }
      };
      my_sound.loadSound(my_slide+".mp3", false);
      }

      Maybe I need a slightly modified "this"? The sound files are a little large, but it does seem as if they should at least play from the Dreamweaver preview...

      I have Flash Player 9 installed, if that could possibly have anything to do with this. Any information will be gladly received.

      Thanks, k
        • 1. Re: More on External Sound Files
          kdock Level 1
          OK, I should have tried this an hour ago.

          I published the HTML from Flash this time, to see if the problem might lie with the Dreamweaver page in which my flash movie was embedded, and... it worked. So, never mind.

          I had adjusted my web page so the flash movie would appear where I wanted it to appear (and only appear once, thank you very much -- lots of reading up on "cooked twice" -- so I had to fiddle with it).

          I'll just have to comb through my web page now, and see how to make it work AND appear in the right spot, and only once.

          k