Alex Hardy


Hello there!

Flash inclusion revisited

A new article on A List Apart by Bobby van der Sluis, called “Flash Embedding Cage Match”, offers a rundown of the options available for including Flash content in a webpage.

It refers to Geoff Stearns’ SWFObject script (my tool of choice), and compares it to Unobtrusive Flash Objects (UFO), which is by the author himself.

Now obviously the implicit message is “my technique is the best, use it”, but he does seem to have a point. UFO’s main advantage is that you can insert your JavaScript before the element that you want to replace with Flash content. SWFObject requires you write the code after it on the page, so you can’t squirrel away your Flash enhancements in a linked JS file. I always thought that was a bit nasty.

I’ll explore UFO more thoroughly before I choose a method for Refresh.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Reddit
  • Ma.gnolia
  • Technorati

9 comments for “Flash inclusion revisited”

  1. Rich

    Hi Alex,

    I was just about to use SWFObject on a site we’re working on here but I might give this other method a whirl. Cheers for the pointer, I’ll let you know how it goes/compares.

    Rich

  2. Alex

    Brent makes a valid point that ideally you would test on the server side that the user agent is capable of displaying your Flash content. Then it would be a matter of either delivering a simple object element or not.

    I’ve got my eye out for a satisfactory technique in PHP that I can adopt.

  3. Rich

    here is a link to a page I have made using the UFO method to display flash, it’s certainly seems a bit easier to use that the SWFObject method.

    I too would love to find a suitable PHP technique to use.

  4. Alex

    Cool :) I’ll try UFO - putting the code in an external file - with a web page I’m working on today. It’d be cleaner that way, so I’ll let you know how that goes.

  5. Alex

    Have a look at this page. The layout construction is a work in progress, so please bear that in mind!

    The upper part of the glove on the left is a Flash object, which will be the homepage navigation. If you look at the source there is a linked JS file called ‘enhance.js’ - that is where the inclusion code lives.

  6. Rich

    sweet, I’m going to tidy up the layout of the site I’m working on too.

    Just on a side note how easy is jquery to use for making contact forms? do I need to use a MySQL database for them? i’ve been struggling with building a suitable contact form in a php page as I’m still fairly new to it, any tips would be of great help.

  7. Rich

    Oh and you should ask Katie all about putting gloves on at the MRI pharmacy unit. I’m sure she’ll be interested in your double gloving website :p

  8. Alex

    I’m using Jquery for client side validation on my contact form, which is programmed but not completely designed yet. I’m using PHP to validate on the server side.

    By all means, have a look. Submit the form without entering any values to see the code in action. It’s pretty powerful stuff and you can make your code much less verbose than with vanilla JavaScript. The “chaining” mechanism that allows you to perform multiple actions on the same element in the same line is handy.

    I’ve not fully cracked how best to do validation of checkbox arrays, but I’m working on that.

    You don’t need to use MySQL with Jquery, but I do store the messages from my contact form in a database.

  9. Rich

    Sounds good, I haad a look at some of the code examples on the Jquery site and it looked like you can do some really clever stuff without too much coding (as you mention), Bonus.

    It’s been such a long time since I used javascript (I think I used it last in university) thanks for the pointers I’m going to have a look at it all now.

Comments are welcome. Keep it friendly and on-topic please.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>