# Connecting Flash to a Port

**URL:** <https://forum.kirupa.com/t/connecting-flash-to-a-port/26774>\
**Category:** flash\
**Created:** [July 26, 2003, 5:44am UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774 "2003-07-26T05:44:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pyr0](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@Pyr0](https://forum.kirupa.com/u/Pyr0)\
**Post date:** [July 26, 2003, 5:44am UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774/1 "2003-07-26T05:44:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 5:46am UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774/2 "2003-07-26T05:46:40Z")

</div>

how are you “connecting” exactly? 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 5:49am UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774/3 "2003-07-26T05:49:42Z")

</div>

I’m using Jeff’s script from [pixelplay.org](http://pixelplay.org) through a link I found here on Kirupaforum.

> **[Pixel Vaping Play - pixelplay.org](http://www.pixelplay.org/jeff/test3/)**
>
> pixelplay.org

Here’s the button action:  
[AS]playbtn.onPress = shoutCast.prototype.playShout(“[http://66.220.21.30:8020/](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]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 6:01am UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774/4 "2003-07-26T06:01:26Z")

</div>

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/](http://66.220.21.30:8020/)’, while it should be something like ‘[http://66.220.21.30:8020/mysongs/song1.mp3](http://66.220.21.30:8020/mysongs/song1.mp3)’

hope this helps =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 6:03am UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774/5 "2003-07-26T06:03:50Z")

</div>

> \*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/](http://66.220.21.30:8020/)’, while it should be something like ‘[http://66.220.21.30:8020/mysongs/song1.mp3](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:

```auto

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 6:14am UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774/6 "2003-07-26T06:14:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 6:15am UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774/7 "2003-07-26T06:15:18Z")

</div>

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

No problem, thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 11:02pm UTC](https://forum.kirupa.com/t/connecting-flash-to-a-port/26774/8 "2003-07-26T23:02:50Z")

</div>

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.
