Tag Archive: release


It seems every time I try something new I need to fix other people’s problems to get it to work, arrrrg! [:(] I decided to try use Flash 8’s ExternalInterface() class to communicate with the Javascript function on my page. I liked the sound of this method because I can pass an array of arguments with it and return a variable back from the Javascript to my Actionscript – all in one command! I whipped something up real quick and bam! it works! Then I moved the SWF into it’s destination: the middle of an HTML form – to my amazement it didn’t work! I was using Internet Explorer 6, so I tried Firefox 2.0 and it worked fine. It also worked fine in Firefox 1.5 (a little less compatible) and even Opera 9.00 Beta! Wow, seriously IE – you got beat by Opera Beta [:P]. It also failed in IE7. To make a long story short, I spent 6+ hours trying to figure out what was wrong – finally I realized the code was fine and it was a IE bug. There’s a bunch of speculation and suggested fixes on the Adobe / Macromedia Flash 8 ExternalInterface() LiveDocs page, but they’re either overly-complicated or they don’t work. So I sat down and figured it out, then I made my own fix, which I consider to be very easy :D.

Here’s the solution: SWFFormFix by me, Steve Kamerman 😀. Here’s the deal, basically, you need to trick Internet Explorer because if you put an object in a form, IE’s implementation of Javascript seems to want to look for “window.yourObject” and not “document.form[x].yourObject”, so my script figures out which form you are in and makes an alias at the wrong location that points to the right location. Don’t believe me? Try it out.

Here are some examples:
A SWF outside of a FORM (using SWFObject to embed)
A SWF inside of a FORM (using SWFObject to embed)
A SWF inside of a FORM (using std Flash EMBED tags)
A SWF inside of a FORM (using SWFObject and SWFFormFix)

As you should see, SWFFormFix fixes the problem and leaves you with zero errors – plus it’s free!

Download SWFFormFix:
http://devel.teratechnologies.net/swfformfix/swfformfix.js

Usage:
1. Include the swfformfix.js script in the head of your document

<html>
<head>
<script type="text/javascript" src="swfformfix.js"></script>
</head>

2. Run the SWFFormFix(yourObject) command on your SWF.

Example with SWFObject (recommended):

<div id="swfdiv_ttpreview" style="width:200px;height:100px;">
This is replaced by the Flash movie.
</div>
<script type="text/javascript">
// <![CDATA[
 var so = new SWFObject("myMovie.swf", "myMovieObjectName",
"200", "100", "6.0.0", "#ffffff");
 so.addParam("quality", "high");
 so.write("swfdiv_ttpreview");
 SWFFormFix("myMovieObjectName");
// ]]>
</script>

Example with std Flash EMBED tags:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
width="200" height="100" id="myMovieObjectName" align="middle">
<param name="movie" value="myMovie.swf" />
<param name="quality" value="high" />
<embed src="myMovie.swf" quality="high" width="200" height="100"
name="myMovieObjectName" type="application/x-shockwave-flash" />
</object>
<script type="text/javascript">
// <![CDATA[
 SWFFormFix("myMovieObjectName");
// ]]>
</script>

If you are still using the old school EMBED tags, you should really get with the program and start using SWFObject!! SWFObject (by Geoff Stearns) not only cleans up your code, but it removes the annoying gray box around your Flash movies in Internet Explorer 7 (or earlier with updates). I made a nice little script called HTML2SWFObject a couple months back that converts your old EMBED code to SWFObject code – check it out!

Let me introduce my latest and greatest software: Tera-WURFL! What the heck is that?!?! Well, ‘Tera’ is just plain cool because it comes from Tera Technologies 🙂 and WURFL is the ‘Wireless Universal Resource FiLe. After a while of testing the WURFL PHP Tools by Andrea Trasatti, I began to notice some major downfalls in the package’s performance. Although the authors did all they could do to make it as fast as possible, the package still uses a file based caching method (albeit a fast one) so store device information. I found the lack of database support disturbing and decided to rewrite the class in my free time and release it myself [:)]. So here it is – Tera-WURFL. My version uses MySQL >= 4.1 and PHP >= 4.3 and performs up to 15x faster than the file based version! I am currently tied down trying to make non-free software and other things so I don’t have a whole lot of extra time to work on Tera-WURFL – sorry.

Basically, this software sits on your webserver and when a web browser requests your site, Tera-WURFL determines whether it’s a desktop web browser or a mobile WAP device, and if it is a mobile device it gives you a TON of information about it like the Make, Model, Screen Size, Ringtone Formats, Image Formats, etc… It’s really quite increadible!

Oh yeah – Tera-Tones.com also uses this detection method to deliver rich media content to handheld devices.