开发者

Embedding Flash in php

I'm using flash to show my charts in the website i have written php file for getting the data from the db,for example say im getting the numbers of males from the db as $males =1067;

i'm using this value like this

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swfl开发者_开发技巧ash.cab#version=8,0,0,0" width="$chartWidth" height="$chartHeight" id="$chartId">
        <param name="allowScriptAccess" value="always" />
        <param name="movie" value="$chartSWF"/>
                <param name=\"wmode\" value=\"opaque\" />
        **<param name="FlashVars" value="$males />**

but what is the problem is i'm not getting the exact value of male 1067, it showing up 1k in my chart of flash how to get the exact value , when i it cross over 1000 it showing as 1k


Always when ever you embed any php code do it within php tags

and to print it you should echo it out

So your code should look like

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="<?php echo $chartWidth; ?>" height="<?php echo $chartHeight; ?>" id="<?php echo $chartId; ?>">
    <param name="allowScriptAccess" value="always" />
    <param name="movie" value="<?php echo $chartSWF; ?>"/>
            <param name=\"wmode\" value=\"opaque\" />
    **<param name="FlashVars" value="<?php echo $males; ?> />**


You'd better use swfobject for embedded flash.

http://code.google.com/p/swfobject/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜