# Dynamic RTMP problem

**URL:** <https://forum.kirupa.com/t/dynamic-rtmp-problem/262311>\
**Category:** flash\
**Created:** [June 4, 2008, 11:22pm UTC](https://forum.kirupa.com/t/dynamic-rtmp-problem/262311 "2008-06-04T23:22:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NebuchadrezZar](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@NebuchadrezZar](https://forum.kirupa.com/u/NebuchadrezZar)\
**Post date:** [June 4, 2008, 11:22pm UTC](https://forum.kirupa.com/t/dynamic-rtmp-problem/262311/1 "2008-06-04T23:22:31Z")

</div>

Ok I’ve got problem with adding RTMP to my tool. I wanted to make my player work with this protocol, but I encounter a “small” problem.

Each time I want to play something that comes from RTMP (as far as I know) I need to use 2 variables (file name and this rtmp server with catalogs). So sourcode looks like this:

```auto

tmpServer = "rtmp://mydomain/somethingmore/evenmore"

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(rtmpServer);
var ns:NetStream = new NetStream(connection_nc);
theVideo.attachVideo(ns);

ns.play("my_file")

```

Looks pretty simple, doesn’t it? But now…the problem is that those 2 variables comes a bit too late and movie won’t start. If I leave them like here… It will work, but in real enviroment those 2 things will be missing until i load them via xml. If I put everything into function and run it after loading these variables - nothing will happen. What should I do now ?
