From: mbrown on
Hi I need to build an SWF with a FLVPlayback component that gets its
FLV source from flashvars pased in at runtime via javascript.

This is the code I am using on the page:

<script type="text/javascript" src="../../../js/swfobject2.js"></
script>
<script type="text/javascript">
var flashvars = {};
flashvars.dSource = "rtmp://www.xxxxx.com/live/xxxx";
var params = {};
params.scale = "noscale";
var attributes = {};
swfobject.embedSWF("swfObj.swf", "mediaspace", "550", "400",
"9.0.0", false, flashvars, params, attributes);
</script>

Using swfobject 2.2

I need a full example of the Actionscript 3 part of this.

I have only this in my Flash file

if(root.loaderInfo.parameters["dSource"] != null)
mattVid.contentPath = root.loaderInfo.parameters["dSource"]

when I compile I get:

1119: Access of possibly undefined property contentPath through a
reference with static type fl.video:FLVPlayback.

From: mbrown on
FWIW, the problem was that I had not added:

MattVid.isLive=true;

To the beginning of the as. And I needed to use source instead of
contentPath (as2).

It works like a charm now!

Final code in as:

MattVid.isLive=true;

if(root.loaderInfo.parameters["dSource"] != null)
MattVid.source = root.loaderInfo.parameters["dSource"]