A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: steaming audio

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Posts
    473
    How would i go about streaming audio files from my web space rather than importing them into flash?

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    dynamically load them, i.e.
    Code:
    s = new Sound();
    s.loadSound("http://www.your_site.com/your_sound.mp3", true);
    s.start();
    playing = true;
    The argument 'true' in the code, causes the sound to stream.
    Setting this to false, causes the sound to wait til it's fully loaded before it plays.

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    6
    If i wanted to do the same thing where would i apply these actions if i had a on/off button

  4. #4
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    on a play button, put this code.
    Code:
    on(release){
     if(!_root.playing){
      _root.s.start();
      playing = true;
     }
    }
    for the stop button put this code on the button
    Code:
    on(release){
     if(_root.playing){
      _root.s.stop();
      playing = false;
     }
    }

  5. #5
    Junior Member
    Join Date
    Jul 2002
    Posts
    6
    and where would these actions go -

    s = new Sound();
    s.loadSound("http://www.your_site.com/your_sound.mp3", true);
    s.start();
    playing = true;


    the button is named music..when i double click music in movie explorer it gives me layer 1 and 2 frames. both have actions of stop();

  6. #6
    Senior Member
    Join Date
    May 2002
    Posts
    278

    mp3 stream

    If you wan't authentic mp3 stream
    go here
    http://www.diamondbarnet.com
    click on mp3 streamming link
    sign up for free trial
    bernie

  7. #7
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    You put the first code in keyframe 1 of the main timeline.
    You put the actions for the buttons on the buttons themselves.

  8. #8
    Junior Member
    Join Date
    Jul 2002
    Posts
    6
    I applied the actions but nothing is playing

  9. #9
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    post the exact code that you put in frame 1 of your movie, and the exact code you put each button

  10. #10
    Junior Member
    Join Date
    Jul 2002
    Posts
    6
    on (release) {
    if (!_root.playing) {
    _root.s.start();
    playing = true;
    }
    }

    On button above

    on (release) {
    if (_root.playing) {
    _root.s.stop();
    playing = false;
    }
    }

    off button above

    and there are many layers but i dont kno which one to put the main code on. The layers are music layer, music controls, music file, and sound button.

  11. #11
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    on the music layer what do you have in frame 1?

  12. #12
    Junior Member
    Join Date
    Jul 2002
    Posts
    6
    I cannot put any code in because it says "current selection cannot have actions applied to it"
    [Edited by james123454 on 07-12-2002 at 05:43 PM]

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