PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Tom Schaefer   QSWFObject   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Explains the use of the class.
Class: QSWFObject
PHP Wrapper to load Flash movies
Author: By
Last change: - change of class file name
- minor adding
Date: 16 years ago
Size: 1,275 bytes
 

Contents

Class file image Download
<HTML>
<BODY bgcolor="#FFFFFF"><?php
$library
= "openflash";
$library_charts = $library . "/";

$dim = array("w" => 640, "h" => 480);

// includes
include_once("../QSWFObject.class.php");

// config
$config = array(
   
"width"=>$dim["w"],
   
"height"=>$dim["h"],
   
"path"=>"./",
   
"url" => "{path-to-php-script-which-renders-open-flash-data}",
);
// objects
$swfObject = new QSWFObject();
$swfObject->addConfig($config);
$swfObject->init();

$swfObject->setParam(array("name"=>"movie", "value"=> $config["path"].'/open-flash-chart.swf?width='. $config["width"] .'&height='. $config["height"] . '&data='. $config["url"]));
$swfObject->setParam(array("name"=>"quality", "value"=>"high"));
$swfObject->setParam(array("name"=>"bgcolor", "value"=>"#ffffff"));
$swfObject->setEmbed(
    array(
       
"src"=> $config["path"].'/open-flash-chart.swf?width='. $config["width"] .'&height='. $config["height"] . '&data='. $config["url"],
       
"quality" => "high",
       
"bgcolor" => "#ffffff",
       
"width"=>$dim["h"],
       
"height"=>$dim["h"],
       
"name" => "charts",
       
"id" => "charts",
       
"swLiveConnect" => "true",
       
"type" => "application/x-shockwave-flash",
       
"pluginspage" => "http://www.macromedia.com/go/getflashplayer"
   
)
);
$swfObject->render();
?></BODY>
</HTML>