Drupal Templating: Insert SWF to Drupal Theme

The easiest way to show Flash object/ SWF is inserting SWF code in a region block that we want to perform. For the simple animation, it can normaly run. But, if the embed SWF contains interaction with ActionScript function, it will definately cause the trouble such as flash interaction disabled in IE (follow this tutorial to fix "Click to Activate" issue on http://www.kirupa.com/developer/flash8/flash_fix.htm). To avoid this embed issue, I put SWF code directly to the Drupal theme on page.tpl.php file. This inserting code is full generated code with FlashObject method to easily display Flash animations without the hassle of having to have your users click first.

Here is my SWF code sample:


<script type="text/javascript" src="flashobject.js"></script>

<div id="flashcontent" style="width: 850px; height: 300px;"></div>

<script type="text/javascript">
var fo = new FlashObject
("/files/banner.swf", "animationName", "850", "300", "8", "#FFFFFF");
fo.addParam("allowScriptAccess", "sameDomain");
fo.addParam("quality", "high");
fo.addParam("scale", "noscale");
fo.addParam("loop", "false");
fo.write("flashcontent");
</script>
OdayPele "Life runs unpredictable". With my educational background I bet you won't believe of being who I am now. Though I knew life is not as simply as unreal world in cyber life but it has led me to enter my professionalism in carrier, bussiness and creation which support to my whole of life.

1 comment for "Drupal Templating: Insert SWF to Drupal Theme"

  1. Hеy there! This is my first visit to your blog! We are a team of volunteers and starting a nеw initiative in a community
    in the same niche. Yoour blog providеd uss valuable infoгmation to wotk
    on. You have done a eҳtraօrdinary job!

    My site :: scott tucker planet technologies

    ReplyDelete

Post a Comment

Iklan Bawah Artikel