Connecting Flash to a Port

Is it possible to have Flash connect to a port besides 80 (http)?

The reason being is that I’m creating a Shoutcast player in Flash/Actionscript.

It works fine when using a Live365 URL which is on port 80. But when I try to use it with a URL to a shoutcast server with a port like 8000 or 8020, it won’t work.

Any way around this?

[Edit] Also, the player functions inside Flash MX with Shoutcast. But when played in a browser such as Mozilla, it won’t function.

how are you “connecting” exactly? :slight_smile:

I’m using Jeff’s script from pixelplay.org through a link I found here on Kirupaforum.

Here’s the button action:
[AS]playbtn.onPress = shoutCast.prototype.playShout(“http://66.220.21.30:8020/”, “Shoutcast”, “100”);[/AS]

And the prototype:
[AS]
shoutCast.prototype.playShout = function(server, name, volume) {
_root.$shoutstatus = “buffering”;
_root.$shoutVolume = volume;
$shoutcache = “initialized”;
_root.$shoutname = name;
_root.$shoutserver = server;
$shoutbuffer++;
_root[“snd”+$shoutbuffer] = new sound();
_root[“snd”+$shoutbuffer].loadSound(server, true);
};
[/AS]

i had a look at the code… the onPress function has to be called like this:[AS]playbtn.onPress = playShout();[/AS]

if you’re using the exact same code as his, you should notice that the ‘server’ argument for the playShout() method is the url for the mp3 file, you had that set as ‘http://66.220.21.30:8020/’, while it should be something like ‘http://66.220.21.30:8020/mysongs/song1.mp3

hope this helps =)

*Originally posted by ahmed *
**
if you’re using the exact same code as his, you should notice that the ‘server’ argument for the playShout() method is the url for the mp3 file, you had that set as ‘http://66.220.21.30:8020/’, while it should be something like ‘http://66.220.21.30:8020/mysongs/song1.mp3
**

Well there isn’t exactly an mp3 file I know of, it’s a live Shoutcast stream. I took the URL from a listen.pls which is a plain text file that WinAMP runs. Here’s a sample:


[playlist]
File1=http://66.220.21.30:8020/
Length1=-1
NumberOfEntries=1
Version=2

hmm… sorry, i can’t help anymore, i’m not familiar with that API :frowning:

*Originally posted by ahmed *
**hmm… sorry, i can’t help anymore, i’m not familiar with that API :frowning: **

No problem, thanks.

Also, upon further research, it appears that Flash MX’s ‘sandbox’ does not allow the port.

However, I can’t find anything on how to work around it.