Re: Having problems with displaying flash from db

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



you have to output only name/value pairs to flash.
call the script with loadVariables in flash and output in this format:
&var1=yonatan&var2=Ben&var3=nes&result=true

you can then test for the true var in flash if the result is ok, otherwise
output false. then use the variables as you want

"Yonatan Ben-Nes" <da@canaan.co.il> schreef in bericht
008f01c27924$cd9569e0$ab0f5ac2@canaan.co.il">news:008f01c27924$cd9569e0$ab0f5ac2@canaan.co.il...
Hi all!

I'm trying to display a flash which is stored at my db (postgresql).
to retrieve the information i created a file named show_swf.swf with this
content:
    <?
     $conn = pg_connect ("dbname=name user=doumind password=hmmmno");
     $filename = $_GET['filename'];
     $sql = "select bin_data from banners where filename='$filename'";
     $res = pg_query ($conn, $sql);
     $data = pg_result ($res, 0, "bin_data");
     header('Content-type: application/x-shockwave-flash');
     echo stripcslashes($data);
    ?>

and i call this file at the code of the flash (i've bolded and underline the
places where i called the file):
function flash_code_up_right($filename) {

     $output = <<<html_snip
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0
,0" width="208"     height="60"><param name="banner_small"
value="show_swf.swf?filename=$filename" /><param name="quality" value="high"
/><param name="bgcolor"                 value="white" />
    <script type="text/javascript">
    <!-- Hide this
    var ShockMode = 0;
    if (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"] &&
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
    if (navigator.plugins && navigator.plugins["Shockwave Flash"])
    ShockMode = 1;
    }
    if ( ShockMode ) {
    document.write('<EMBED SRC="show_swf.swf?filename=$filename"');
    document.write(' swLiveConnect=FALSE width=208 height=60');
    document.write(' QUALITY=high ');
    document.write(' TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?1_P od_
ers on= hoc wav Flah"> ); doc ument.write('</EMBED>');
    } else if (!(navigator.appName &&
navigator.appName.indexOf("Netscape")>=0 &&
navigator.appVersion.indexOf("3.")>=0) || (navigator.appName &&
navigator.appName.indexOf("Netscape")>=0 &&
navigator.appVersion.indexOf("2.")>=0)){
    NoFlash();
    }
    function NoFlash() {
    document.write('get flash');
    }
    // Done -->
    </script></object>

    html_snip;

    return $output;
    }

now when i do this i c instead of the flash a white square with the right
measures.
if i just call show_swf.swf?filename=filename from the address row at the
browser i can c the flash being displayed but its huge (all over the
screen).

does anyone have any idea or can just give me a link to related info?

With Thanks in Advance!
Yonatan Ben-Nes




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux