I have a movie player that works fine when i hard-code the url value in the video function, but when i try to pass that url/file path from an external file, the video doesn’t load. I suspect that there is something i’m doing wrong with the quotes or maybe i just don’t get how to pass a variable to a function.
var vfile = "path";
supervideo = function () {
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream (netConn);
video.attachVideo(netStream);
netStream.setBufferTime(10);
netStream.play(vfile);
};
loadText.load(_global.text_url1);
loadText.onLoad = function(success) {
if(success){
showtitle.text = this.title1;
vfile = this.flv_name;
supervideo();
}
}
The value in the php file looks like this:
&flv_name="elements/flv/superape.flv"&
So ultimately i want to end up with
netStream.play("elements/flv/superape.flv");
. I have tried defining the variable w/ and w/out the “:String”. The video portion of the code seems to not use the variable correctly when it is in a function. If you have suggestions or see any errors please let me know. Thanks!
File is here (in MX format, though i am using MX2004) if you have time to take a look.