Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6184259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:30:21+00:00 2026-05-24T01:30:21+00:00

I’m using Flex Player component on a localhost. The FLV video files are stored

  • 0

I’m using Flex Player component on a localhost. The FLV video files are stored in bin-debug/Video Source. The PHP code for the video is:

$id = $_GET["id"];
    $media = getDirectoryList("bin-debug/Video Source");

    if($media[$id] != null){
        $video = $media[$id];
        $fileName = "bin-debug/Video Source/".$video;
        $pieces = explode(".", $video);
        $video = $pieces[0];
     }

The player is generated on the HTML page via javascript where createPlayer(); writes FlexPlayer.swf on the page between object tags

<script type="text/javascript">
    createPlayer();
</script>

My question is where and how to put the $video variable to dynamically load video in this FlexPlayer.swf. CreatePlayer() is:

function createPlayer("<?php echo $fileName; ?>"){
    document.writeln("<div id=\"player\">");
    document.writeln("<object width=\"489\" height=\"414\">");
    document.writeln("<param name=\"player\" value=\"bin-debug/FlexPlayer.swf\">");
    document.writeln("<embed src=\"bin-debug/FlexPlayer.swf\" name=\"player\" width=\"489\" height=\"414\">");
    document.writeln("</embed>");
    document.writeln("</object>");
    document.writeln("</div>");               
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:30:22+00:00Added an answer on May 24, 2026 at 1:30 am

    You can pass variables to your swf file using flashVars properties

    Without seeing the code for createPlayer() I cannot give you specific details about how you should do this.

    Assuming that your video player is showing one video only and the id for that video is passed to the web page using POST or GET then pass the file name using flashVars. For this a recommend using swfobject. Something like this should do the trick:

    webpage.php

    <?php
        //your stuff
        $video = phpFunctionToGetTheFilePath($id);
        //more stuff
    ?>
    <html>
        <head>
            <!-- head stuff,the javascript function declaration to display the video player -->
            <script type="text/javascript">
                createPlayer("<?php echo $video; ?>");//the function's argument is the filename to pass as flashvars
            </script>
        </head>
        <body>
            <!-- your player container somewhere here -->
        </body>
    </html>
    

    If you want to change the video displayed without refreshing the page then consider using AJAX to get the file name or just pass the id to the flash player and do the work in flex (flex gets the id and retrieves the filename from the server using XML or amf)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.