Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 4 of 4
  1. #1

    Default streaming audio?

    I am trying to stream audio from an external swf which works fine but I would like to add a pause button. I do not know how to pause an external swf loaded through levels.

    Here is the code I'm working with (please see http://www.flashkit.com/tutorials/A...t-881/index.php):

    For the play button I have:

    Code:
    on (release) {
    unloadMovieNum(66);
    loadMovieNum("song1.swf", 66);
    }
    For the stop button I have:

    Code:
    on (release) {
    unloadMovieNum(66);
    }
    I tried this for the pause button:

    Code:
    on (release) {
    tellTarget("song1.swf", 66){stop();}
    }
    but no result

    Am I going about this the right way or do I need to restructure the way I have created this. I am fairly new to flash and I am completely stumped. Any help would be greatly appreciated. Thanks.

  2. # ADS
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    You can control any loaded movie with the path that it was loaded with. I prefer to load into a movieclip as it gives you a few more presentation options, but if your loading a movie into a level, to control that movies timeline, use the path you used to load it.......

    _level66.stop();

    You could also use the stopAllSounds method...

    _root.stopAllSounds();

    If your using Flash MX or higher, there is a built in object for dealing with sound. Loading sound into a .swf that you load into another movie is Flash 5 methodology. The sound object can dynamically load external mp3 files at runtime. I have an mp3 player demo on my site that loads external MP3 files dynamically into the sound object.

    Code:
    mySound = new Sound();
    myButton.onRelease=function() {
    	mySound.loadSound("someSoundFile.mp3",true);
    }
    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  4. #3

    Default

    Thanks for the help. I decided to stream mp3 audio as per you suggestion; however I was wondering, when I perform the function: mySound.stop(); will the audio continue to download until the file is complete or will downloading cease as well. Thanks in advance.

  5. #4
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    The stop and start methods for the sound object only refer to starting or stopping the sound. The start method is not needed if the sound is set to stream(true for the second parameter). The sound will automatically start after enough of the file has downloaded into the player(usually around 3 to 5 seconds).If using event sound(false for the second parameter), the sound must be started manually and will only play after the entire file downloads. Once you initiate the load of the sound file, the file will download completely regardless of the start or stop method.

    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Streaming audio problems with mozilla firefox
    By sound loop studio in forum Sound and Music
    Replies: 5
    Last Post: 01-31-2008, 11:57 PM
  2. Replies: 3
    Last Post: 10-12-2007, 01:22 PM
  3. Streaming audio in Firefox / Safari
    By dirtyrottendan in forum Sound and Music
    Replies: 0
    Last Post: 09-19-2006, 01:01 PM
  4. Streaming The Music
    By RedDevil in forum Sound and Music
    Replies: 2
    Last Post: 01-08-2006, 04:40 PM
  5. Pause an external streaming .swf audio file
    By jay05 in forum Sound and Music
    Replies: 3
    Last Post: 06-14-2005, 06:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial