A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: SWF to play FLV passed as a get variable

  1. #1
    Junior Member
    Join Date
    Nov 2006
    Posts
    3

    SWF to play FLV passed as a get variable

    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

  2. #2
    Junior Member
    Join Date
    Nov 2006
    Posts
    3
    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

  3. #3
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Quote Originally Posted by tdromba
    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

  4. #4
    Junior Member
    Join Date
    Nov 2006
    Posts
    3
    Okies, thanks, Blanius. I'll move ahead from there.

    td

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center