# Code for calling rtmp?

**URL:** https://forum.kirupa.com/t/code-for-calling-rtmp/224723
**Category:** flash
**Created:** [May 4, 2007, 7:51pm UTC](https://forum.kirupa.com/t/code-for-calling-rtmp/224723 "2007-05-04T19:51:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![will\_s](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@will\_s](https://forum.kirupa.com/u/will_s)
#### Post date: [May 4, 2007, 7:51pm UTC](https://forum.kirupa.com/t/code-for-calling-rtmp/224723/1 "2007-05-04T19:51:35Z")

</div>

Hi,

I want a song to accompany a Flash slide show; but placing the song in the .swf makes the file load too slowly, even over a good DSL connection.

So I thought, since it’s just non-synched background music, streaming the audio would speed things up.

I uploaded the song as a sound file in the form of an .flv to my favorite streaming video server site. (I tested it beforehand and it worked great.)

A techie at the server company suggested I use their rtmp code to load it into my slide show file. Their rtmp code looks something like this:  
/\* wonderfulworldaudiortmp://00.000.000.00/fvssod/fandm00.000.000.00 \*/  
(I’ve replaced the real numbers with zeros.)

I guess I need some actionscript to call this but can’t find the right combo on the internet.

I’ve tried things like:  
/\*var videoInstance:Video = WonderfulWorldAudio;  
var nc:NetConnection = new NetConnection();  
var connected:Boolean = nc.connect(“rtmp:/00.000.000.00//fvssod/fandm00.000.000.00”);  
var ns:NetStream = new NetStream(nc);  
videoInstance.attachVideo(ns);  
ns.play(“WonderfulWorldAudio”);  
\*/

and like this:

/\*\*  
Requires:

- FLVPlayback component on the Stage with an instance name of my\_FLVPlybk  
_/  
import mx.video._;  
trace("Before load, autoPlay is: " + my\_FLVPlybk.autoPlay);  
my\_FLVPlybk.load(“[http://www.helpexamples.com/flash/video/water.flv](http://www.helpexamples.com/flash/video/water.flv)”);  
trace("After load, autoPlay is: " + my\_FLVPlybk.autoPlay);  
my\_FLVPlybk.play();  
\*/

But haven’t hit the number yet.

Any ideas?

Thanks.
