;

PDA

Click to See Complete Forum and Search --> : SWF to play FLV passed as a get variable


tdromba
11-22-2006, 03:15 PM
Hi all:

I've build quite a few swf's which play video and audio, but now I need to build some which can play mp3 or flv based on a get variable, e.g.:

http://foo.com/player.swf?movie=bar.flv

So, the swf needs to be able to load the flv or mp3 dynamically based on the url, in other words.

Any clues how to start? I've done a reasonable amount of action scripting but not this particular problem.

Thanks in advance for your help.

TD

tdromba
11-27-2006, 06:33 PM
Well, no responses. How can I word this differently, perhaps more clearly.

I not familiar with how a swf retrieves variables from a url. For example, in PHP, all 'GET' variables (those appended to a url) are available in the $_GET[] array, post variables in $_POST, cookie vars in $_COOKIE, etc.

And, in javascript, you can set the 'src' attribute of an image. So you can simply do myimage.src="./foo.gif" to change it.

So I simply need to know how to more or less replicate those behaviours in a SWF using action script. How can I retrieve the value of a GET variable via action script, and use that value to set the stream source for an FLV object in a SWF movie.

Thanks in advance if you can help.

Best,
td

blanius
11-27-2006, 08:19 PM
Hi all:

I've build quite a few swf's which play video and audio, but now I need to build some which can play mp3 or flv based on a get variable, e.g.:

http://foo.com/player.swf?movie=bar.flv

So, the swf needs to be able to load the flv or mp3 dynamically based on the url, in other words.

Any clues how to start? I've done a reasonable amount of action scripting but not this particular problem.

Thanks in advance for your help.

TD
That would work actually you that should give you a variable named movie set to equal bar.flv

tdromba
11-28-2006, 02:35 PM
Okies, thanks, Blanius. I'll move ahead from there.

td