5 Replies Latest reply on Mar 7, 2007 8:06 AM by kglad

    loadSound

    jude86 Level 1
      Hello,

      I am wondering if anyone out there can help me!!! I'm in desperate need of a fix for a sound problem i have. I know how to fix this problem if i import the sound into the flash file. But i cant do this with this example because the sound file is too large!!

      I have some sound files dynamically loaded into my flash file using the loadSound("",false) command.

      However i can't get the tracks to pause or fastforward or rewind. Does anyone have any idea how i can do this?? Is there a function out there somewhere that will help me, normally i just speed up the frame rate or reduce for the fastforward/rewind button, but i cant do this in this case as the sound is an external mp3 file :|

      Please help, i'm desperate!!???

      Many thanks
        • 1. Re: loadSound
          kglad Adobe Community Professional & MVP
          check the sound class in the flash help files. you must have already created a member of the class to use the loadSound() method.

          you can also use the stop() and start() methods of the sound class and the position property to control your sound including pausing, ff'g and rewinding.
          • 2. Re: loadSound
            jude86 Level 1
            I have tried using the position class to pause the sound file, below is the code that i used, however it doesn't work, maybe there is an error somewhere??

            Many thanks

            When i trace the variable soundPosition, in the pause button, it is undefined, so i believe the code which isnt working is the line "soundPosition = mySound.position" because if i set the position to any random number, this works?!?
            • 3. Re: loadSound
              kglad Adobe Community Professional & MVP
              you only need to create one sound object. re-creating it in each of your button handlers is causing a problem:

              • 4. Re: loadSound
                jude86 Level 1
                that's great thank you so much for that, i had the sound class declared inside of the play button function this is where i was going wrong?!!!!?

                You mention previously that i could use the position property to make the sound pause, ff and rewind. How would i use this to make the track ff/rewind???

                Many thanks it is greatly appreciated :D
                • 5. Re: loadSound
                  kglad Adobe Community Professional & MVP
                  stop your sound and start a loop when those buttons are pressed. in each loop iteration increase (for ff) or decrease (for rewind) soundPosition.

                  you'll usually need to give the user some visual feedback about soundPosition so they can see how far they are advancing or rewinding. on release start your sound using the updated soundPosition.