Contributions
Activate Flash Immediately
If you incorporate Flash, or any other type of <object> or <embed> controls into your OSC, you're probably annoyed by the "click here to activate and use this control" annoyance that Microsoft came up with in 2005. You have to hover over it, click it once, and then your Flash will begin to work. Many people don't know how to fix this, and it's annoying, especially if you have, say, a Flash menu. So here's what you do:
(1) Upload fixit.js to your server.
(2) Simply place this following line after the last <object> in your page:
<script type="text/javascript" src="fixit.js"></script>
Simple as that! Flash files, embedded objects, Active X controls, etc., will all work immediately in your OSC without the annoyance of the "click to activate" thing ever again!
Jason
Expand All / Collapse All
Put this code in js script tag or in js file and link with your page :
<script type="text/javascript">
function write(source) {
document.write(source);
}
</script>
In your PHP page put this code, where $IpBanner is the html code for this object.
This is working with all obejct, not only with flash objects.
<?php
$IpBanner = '<object type="application/x-shockwave-flash" data="images/banners/gol.swf" width="468"height="60"><param name="movie" value="images/banners/gol.swf" /><param name="wmode" value="transparent"></object>';
?>
<script type="text/javascript">
var source = '<?php echo $IpBanner; ?>';
write(source);
</script>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Of course this is a example. If you undertstand you don't will have more problems.
For example, I update this function to show flash banners :
function tep_display_banner($action, $identifier) {
if ($action == 'dynamic') {
$banners_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
$banners = tep_db_fetch_array($banners_query);
if ($banners['count'] > 0) {
$banner = tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
} else {
return '<b>(tep_display_banner(' . $action . ', ' . $identifier . ') -> Nenhum banner cadastrado para o grupo '' . $identifier . '' !</b>';
}
} elseif ($action == 'static') {
if (is_array($identifier)) {
$banner = $identifier;
} else {
$banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int)$identifier . "'");
if (tep_db_num_rows($banner_query)) {
$banner = tep_db_fetch_array($banner_query);
} else {
return '<b>(tep_display_banner(' . $action . ', ' . $identifier . ') -> Banner com id '' . $identifier . '' não encontrado, ou status inativo</b>';
}
}
} else {
return '<b>(tep_display_banner(' . $action . ', ' . $identifier . ') -> Parâmetro $action desconhecido - deve ser 'dynamic' ou 'static'</b>';
}
if (tep_not_null($banner['banners_html_text'])) {
$banner_string = $banner['banners_html_text'];
} else {
if ( substr($banner['banners_image'], -3, 3) == 'swf' ) {
$size = getimagesize(DIR_WS_IMAGES . "banners/". $banner['banners_image']);
$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . mm_output_flash_movie( $banner['banners_title'], DIR_WS_IMAGES . "banners/". $banner['banners_image'] , $size[0] , $size[1]) . '</a>';
} else {
$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . "banners/". $banner['banners_image'], $banner['banners_title']) . '</a>';
}
}
tep_update_banner_display_count($banner['banners_id']);
return $banner_string;
}
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Good luck!
Best Regards
Sylvio Ruiz
Rio de Janeiro - Brazil
Hi there...
This is my 2nd contribution (i hope so..)
I've tried so many times to upload & play my flash in header.php but it didnt worked(movie not uploaded!)!
So, i just put simple coding in header.php and it worked!
------------------------------------------------------------------------------------------
1st: Upload your flash.swf in /catalog/images
(it will look like this ---> /catalog/images/flash.swf
2nd: ADD THIS CODING IN YOUR HEADER.PHP
table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><iframe allowTransparency="true" src="http://yourdomain.com/catalog/images/flash.swf" width=100 height=100 frameborder=0 marginheight=0 marginwidth=0 scrolling="no">
</iframe></td></tr></table>
You can view the example at www.pearls.com.my
Hope this will help :)
Shah
There is a very minor update made to the javascript file. For some reason the original one was causing IE to try and download objects that didn't exist. It made my site appear as though it was still loading. This updated file has not had any flaws that I have seen yet.
If you incorporate Flash, or any other type of <object> or <embed> controls into your OSC, you're probably annoyed by the "click here to activate and use this control" annoyance that Microsoft came up with in 2005. You have to hover over it, click it once, and then your Flash will begin to work. Many people don't know how to fix this, and it's annoying, especially if you have, say, a Flash menu. So here's what you do:
(1) Upload fixit.js to your server.
(2) Simply place this following line after the last <object> in your page:
<script type="text/javascript" src="fixit.js"></script>
Simple as that! Flash files, embedded objects, Active X controls, etc., will all work immediately in your OSC without the annoyance of the "click to activate" thing ever again!
Jason
Note: Contributions are used at own risk.