dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Streaming with linkage and turning it on and off.

  1. #1
    BradyWhite.net Kac's Avatar
    Join Date
    Nov 2000
    Location
    Orem, UT
    Posts
    576

    Wink

    Thanks for coming in.

    I'm new to sound so I hope this isn't a repost, I've looked at other posts and really didn't understand them.

    What I'm trying to do:
    I have this huge 11 MB MP3 ambient music file to play with my site. I don't want the user to preload the entire thing before it plays, so I want it to stream. I don't know how to make it stream and be able to have the functions of turning it on and off. Is there a tutorial for this? Or a movie I could download? I've tried various things but my knowledge in the Sound Actionscript department isn't very deep.

    Can you use things such as setVolume on a streaming clip? How would you do it? How do you stream using actionscript?

    I'm using MX.

    Thanks, I know I can always count on the flashkit community.

    -Kac

  2. #2

    Cool Music that never stops

    we got you covered Kac.

    You know how to load an external SWF into a Movie Clip? ( loadMovie(RelativeURL,Level,Target))

    If you have your song as the ONLY item in an SWF with a "goToAndStop(1)" action at the end you can load it into an empty (what I call "shell") MC from your interface at any time. You can also controll that SWF's timeline as if you were controling the timeline of the shell MC. If you set your sound to "stream" and make room for the whole thing on it's timeline, then it will start and stop in place just like an MC.


    So in lew of using the Sound Object, this is a way to have an independantly loading and controlled Sound.

    TaTa

  3. #3
    Moderator
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    -----
    I don't know how to make it stream and be able to have the functions of turning it on and off.
    -----
    place the sound on the root timeline of a SWF. add enough frames to see the entire sound's waveform. set it to stream sync. choose a bit rate that is lower than your target audience's connection speed.

    like mani_sf says you can place the sound in its own SWF and load it into a movie clip or level of the embedded player using loadMovie or loadMovieNum. Or you can just put the sound on the root timeline of your main movie.

    you can pause/resume stream sounds with the stop() and play() actions. stopAllSounds() stops and "rewinds" a stream sound back to the beginning.

    -----
    Can you use things such as setVolume on a streaming clip? How would you do it? How do you stream using actionscript?
    -----
    you can control sounds in a timeline with a sound object.

    ex.

    mystream = new Sound(target path to timeline containing sound);
    mystream.setVolume(50); // change volume to 50%

    read Remixology #1-2 for more information on the sound object. see sig for link.

    Flash 6 allows you to "stream" native mp3 using the loadSound() method but due to poor support of sound object fatures this approach does not give you the same playback control as loading sound only SWF.

  4. #4
    BradyWhite.net Kac's Avatar
    Join Date
    Nov 2000
    Location
    Orem, UT
    Posts
    576
    I love you guys!

    I got it working perfectly as I want

    if you would like to see my site that it is on...

    http://rapfiregraphix.com/brady/index.htm

    Thanks again so much! I really appreciate it!

    -Kac

  5. #5
    BradyWhite.net Kac's Avatar
    Join Date
    Nov 2000
    Location
    Orem, UT
    Posts
    576
    DOH!

    I was messing with some stuff and this is whats happening...

    Now when it loads it, it opens a new browser window with the URL... how do I make it not open the window?

    Also, if you know, how do you make it so that the only thing it says when you right click is settings? Like turn off the zoom in/out/showall etc.

    Thanks!
    -Kac

  6. #6
    Loop Junkie calpomatt's Avatar
    Join Date
    Mar 2001
    Location
    CA
    Posts
    855
    The way I've done it in the past is using 2 simple actionscript codes.

    For the play button, I have
    Code:
    on (release) {
        loadMovieNum ("music.swf", 1);
    }
    And for the stop button, I have
    Code:
    on (release) {
        unloadMovieNum (1);
    }
    Here's a working sample where I streamed the song and added a little motion tween to show the track progress: http://calpomatt.lavista.org/Grunge.html

    - Matt

  7. #7
    Loop Junkie calpomatt's Avatar
    Join Date
    Mar 2001
    Location
    CA
    Posts
    855
    And for your other question, just put menu=false in the <embed> tags on your html page.

    Just like this:

    <embed src="Movie.swf" menu=false quality=high height="100%" width="100%"></embed>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center