Adding Flash in a Joomla Article and Flash Vars

Here is an example of adding Flash in Joomla. In this case one Flash movie reads 5 different picture lists in 5 different XML files. Which XML file to read is passed in a  “flash var” that is read by the Flash movie.

http://www.grimeyphoto.com/index.php/portraits

Here is how I did it.

  1. Download and install HTMLMod, so you can add custom php to you Joomla site. http://extensions.joomla.org/extensions/edition/custom-code-in-modules/5435
  2. I used dreamweaver to give me the initial Flash embed code.
  3. You will need to FTP the “Scripts” folder to the root directory of your Joomla install.
  4. Create the HTMLmod with the parts of code below that you need, and give it a position like “user6”. You may have to add the position manually.
  5. Load the module in the article by using {loadpostion user6} in the article where you want the Flash element to show up.

The code in the module:

<?php

$xml = “gallery_kids.xml”; // the name of the XML document
$movie = “photo_gallery.swf”;  // the flash file
$moviePath = “where ever you want to place the flash “;
$width = “550px”;
$height = “350px”;

?>
<p>
<object id=”FlashID” classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ width=”<?php echo $width; ?>” height=”<?php echo $height; ?>”>
<param name=”movie” value=”<?php echo $moviePath. $movie; ?>” />
<param name=”quality” value=”high” />
<param name=”wmode” value=”opaque” />
<param name=FlashVars value=”<?php echo ‘my_xmlList=’ . $xml; ?>” />
<param name=”swfversion” value=”8.0.35.0″ />
<!– This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. –>
<param name=”expressinstall” value=”Scripts/expressInstall.swf” />
<!– Next object tag is for non-IE browsers. So hide it from IE using IECC. –>
<!–[if !IE]>–>
<object type=”application/x-shockwave-flash” data=”$moviePath. $movie; ?>” width=”<?php echo $width; ?>” height=”<?php echo $height; ?>”>
<!–<![endif]–>
<param name=”quality” value=”high” />
<param name=”wmode” value=”opaque” />
<param name=FlashVars value=”<?php echo ‘my_xmlList=’ . $xml; ?>” />
<param name=”swfversion” value=”8.0.35.0″ />
<param name=”expressinstall” value=”Scripts/expressInstall.swf” />
<!– The browser displays the following alternative content for users with Flash Player 6.0 and older. –>
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href=”http://www.adobe.com/go/getflashplayer”><img src=”http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif” alt=”Get Adobe Flash player” width=”112″ height=”33″ /></a></p>
</div>
<!–[if !IE]>–>
</object>
<!–<![endif]–>
</object>
</p>
<script type=”text/javascript”>
<!–
swfobject.registerObject(“FlashID”);
//–>
</script>

Using HTML in Director

I spent sometime working with putting HTML formatted text into a Director field. First step is to format the text into HTML code and put it into a “field” member or a varible. Then make the “html” of a “text” member have the text of the field.

I have found that I needed to fill the “Text” member with html formatted text when the movie starts; otherwise, it didn’t always work and was frustrating to figure out why.

Example using a variable.

htmltext = “<html><body bgcolor=’ffffff’>”
put “<table width=’685′ border=’0′ cellpadding=’3′>” after htmltext

put “<tr ><td width=’75’><font color=’#000000′ size=” face=’Verdana, Arial, Helvetica, sans-serif’>TD #1</font></td>\
<td width=’70’><font color=’#000000′ size=’3′ face=’Verdana, Arial, Helvetica, sans-serif’>TD #2</font></td>\
<td width=’70’><font color=’#000000′ size=’2′ face=’Verdana, Arial, Helvetica, sans-serif’>TD #3</font></td>\
<td width=’450′><font  size=’2′ face=’Verdana, Arial, Helvetica, sans-serif’><a href=’somelink’>Da Link</a></font></td>\
</tr>” after htmltext

put “</table></body></html>” after htmltext

member(“show text”).html = htmltext

Grimes is im-Word-Pressed!

Sometimes a web geek can get so jived from new software and Word Press gave me a rush after installing it. I was able to use fantisico with my webhost which made the install take about 5 seconds. Nothing worse than struggling with install software that is going to make your life easy.