Post by seanjohn » Wed Aug 12, 2009 11:13 pm

Hie,

Ken u assist me i would like to add a Flash ad on my template, how do i do it?

O0

Newbie

Posts

Joined
Mon Aug 03, 2009 5:20 pm

Post by Qphoria » Wed Aug 12, 2009 11:38 pm

depends where you want it. it goes in the catalog/view/theme/default/template/*tpl file that you want it to show up on (home, header, etc)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by piseth » Thu Aug 13, 2009 3:59 am

I have no background of HTML but just a flash file so is there any sample codes to place in the header?

Thanks,
Piseth :)

Piseth
Phnom Penh, Cambodia
http://www.cambodia365.com


User avatar
New member

Posts

Joined
Sun May 03, 2009 4:20 am
Location - Cambodia

Post by CodeBits » Fri Aug 14, 2009 1:08 am

The code to embed Flash into a page;
NOTE: this will not validate, but it will work. If you want it to validate keep reading.

Code: Select all

  <object
  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0"
  id="slideshowbanner"
  width="768" height="170">
  <param name="movie" value="yourfile.swf">
  <param name="bgcolor" value="#336699">
  <param name="quality" value="high">
  <param name="loop" value="false">
  <param name="menu" value="false">
  <param name="wmode" value="transparent">
  <param name="allowscriptaccess" value="samedomain">
  <embed
    type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer"
    name="movie"
    width="768" height="170"
    src="yourfile.swf"
    bgcolor="#336699"
    quality="high"
    loop="false"
    menu="false"
    wmode="transparent"
    swliveconnect="true"
    allowscriptaccess="samedomain">
    <noembed>
    </noembed>
  </embed>
</object>
To embed Flash or any other multimedia content you need a little javascript. There are several free scripts to do this task, one I use is flashfix.js and is very easy to use, you can set any number of embedded media with it on one page by using unique naming conventions of the id, and it validates with W3C standards.

Example;
flashfix.js

Code: Select all

function writeFlash(id) {
document.getElementById(id).innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0' id='pan' width='760' height='100'><param name='movie' value='pan.swf'><param name='bgcolor' value='#FFFFFF'><param name='quality' value='high'><param name='loop' value='false'><param name='menu' value='false'><param name='wmode' value='transparent'><param name='allowscriptaccess' value='samedomain'><embed type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' name='pan' width='760' height='100' src='pan.swf' bgcolor='#FFFFFF' quality='high' loop='false' menu='false' wmode='transparent' swliveconnect='true'  allowscriptaccess='samedomain'></embed></object>";
}
The web page;

Code: Select all

<div id="flash_container"></div>

<script type="text/javascript">
writeFlash('flash_container');
</script>
And add this to the head of your document;

Code: Select all

<script type="text/javascript" src="flashfix.js"></script>
That's it... ;)

User avatar
Active Member

Posts

Joined
Fri Jun 05, 2009 3:16 am

Post by Qphoria » Fri Aug 14, 2009 1:26 am

You need javascript for embedded flash? Since when?

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Leon » Fri Aug 14, 2009 1:27 am

Qphoria wrote:You need javascript for embedded flash? Since when?
Exactly my thoughts

Active Member

Posts

Joined
Tue Apr 07, 2009 1:20 am

Post by CodeBits » Fri Aug 14, 2009 2:59 am

If you read my post, I state, [ IF you want your page to Validate to W3C Standards ]
I should add that it's the embed tag that causes the problem, if you omit the embed tag you should validate ok, but some older browsers may not see your media.

reference:
http://www.v7n.com/forums/coding-forum/ ... d-tag.html
http://www.w3.org/
http://www.alistapart.com/articles/flashsatay/
http://www.html4.com/mime/markup/php/ac ... ates_3.php

User avatar
Active Member

Posts

Joined
Fri Jun 05, 2009 3:16 am

Post by rudilim » Mon Dec 31, 2012 4:18 pm

In your <body>, where you want the flash object to appear, insert this code:
(ignore class="bird", that is my own CSS class)

Code: Select all

<div class="bird" id="swf_file"></div>
       
       <script type="text/javascript">

$(document).ready(
function() {
$('#swf_file').flash(
		{'src':'catalog/view/theme/mytheme/image/birdie.swf' ,
		'height':'150' ,
		'width':'150'
		}
		);
}
);
</script>
And in the <header>, insert this:

Code: Select all

<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery.flash.js"></script>
You will need to download the jquery.flash.js and jquery-1.7.1.min.js files and put them in the right folder for it to work.

Newbie

Posts

Joined
Sun Dec 16, 2012 1:22 pm
Who is online

Users browsing this forum: No registered users and 17 guests