A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Internet radio

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    11

    Internet radio

    Hello
    I am trying to make an internet radio player with Flash.
    I am using this code:
    Code:
    var my_sound:Sound = new Sound();
    my_sound.loadSound("URL_here", true);
    The problem is that, some of the stations/url-s work and some of them wont work.
    For example this is working fine:
    Code:
    var my_sound:Sound = new Sound();
    my_sound.loadSound("http://stream05.akaver.com/skyplus_hi.mp3", true);
    But this one is not working:
    Code:
    var my_sound:Sound = new Sound();
    my_sound.loadSound("http://83.145.249.104", true);
    I tried Native flash Radio V2, and with that the other url worked also. So I guess I am doing something wrong here.

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    The one not working, I just copied the code and pasted it in Flash 8 (Actionscript 2.0, Flash Player 8), and it worked just fine
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Mar 2009
    Posts
    11
    ok, so wh it is not working for me?
    I am using CS5 and flash player 8

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Tried it in CS5 as well (with both Flash Player 10 and 8) just now, and it worked flawlessly

    Would you mind posting your FLA file, and state what possible errors you are getting?
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  5. #5
    Junior Member
    Join Date
    Mar 2009
    Posts
    11
    I will post fla file tomorrow, when I am back home.

    I did nothing else, just pasted this code to first frame of emty movie and tested it.
    Code:
    var my_sound:Sound = new Sound();
    my_sound.loadSound("http://83.145.249.104", true);
    My friend tested it also, with same results.
    And, I did not get any errors.'It just wont play.

  6. #6
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Strange, really strange, you sure you're using AS2?

    Maybe it's because we have different internet connections and are from different countries
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  7. #7
    Junior Member
    Join Date
    Mar 2009
    Posts
    11
    Yes, I am using AS2
    And its working with "Native Flash Radio"
    Here is sample file: http://kkert.planet.ee/raadiotest/example.html

    But I would like to build my own player.

  8. #8
    Junior Member
    Join Date
    Mar 2009
    Posts
    11
    Ok, here is the fla file: http://kkert.planet.ee/stuff/radio.fla
    I saved it as CS4 compatible file

  9. #9
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Working perfectly here
    Opened it in CS5, and tested the movie. The sound showed up at once. Either it's your internet connection, or maybe it's because of CS4. Try uploading the SWF file to your server and test it online
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  10. #10
    Junior Member
    Join Date
    Mar 2009
    Posts
    11
    I tried that, but still no sound
    I dont think its my connection problem, because the "Native Flash Radio" works fine:
    http://kkert.planet.ee/raadiotest/example.html

    And my file:
    http://kkert.planet.ee/raadiotest/test2.html


  11. #11
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Really strange, now it didn't work for me either. Read that Flash only supports MP3 files at runtime, so if maybe the radio is playing non-MP3 files, then it's not working. But, I tried this in Flash 8, and it didn't work, but I opened up CS5 and tried it there, and it worked, and then I tried in Flash 8 again, and it's working there now as well - mystery :O

    and I think that the Native Flash Radio is using a 3rd party tool to play other music formats, because I saw that WinAMP logo, and that must be the one aiding the Flash.

    But it's not working on your website, and when I played a YouTube video first and then at the same time the radio from Flash, it didn't work, but after pausing and re-trying, it worked flawlessly.

    There's really something odd here :/
    Last edited by Nig 13; 05-24-2012 at 03:59 PM.
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  12. #12
    Junior Member
    Join Date
    Mar 2009
    Posts
    11
    The winamp logo is there just because you can export winamp playlists.

  13. #13
    Junior Member
    Join Date
    Mar 2009
    Posts
    11
    hmm.. ok... I tried again and found out that it works with AS3 but not in AS2.
    With AS3:
    Actionscript Code:
    var s:Sound = new Sound();
    s.load(new URLRequest("http://83.145.249.104"));
    s.play();

    And in AS2:
    Actionscript Code:
    var my_sound:Sound = new Sound();
    my_sound.loadSound("http://83.145.249.104", true);

    Is there a way to get it working with AS2? Because I have already build my player with AS2 and I have not used AS3 before.

    Or can someone help me to translate the code to AS3 if I paste my code here?

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