Part 1--The Function
That code just sets things up. Notice the working part of the code above is in bold. I simply check the useragent to see if it matches a pattern of any of the Apple Mobile devices. Now wherever you want to place a Flash document, you need to use Part 2.
Part 2--Inserting the Flash File
This small piece of code uses the previous function in order to display the flash. Only the first three values are required, the rest are optional. Let's see what they do. Note: The width and the height are not in quotes, all the others are...make sure you include the quotes.
Part 3--What are the different options
This is the location of your flash .swf file.
Width & Height
This is the width and height of the swf file. You can use this code to place regular swf files without an alternate image file if you leave everything else blank and only use these first three attributes.
This is the location of the alternate graphic you want to display if this is an iPod, iPod Touch or iPad.
If you want to have the image click to a URL, just insert the URL here. If you don't include a URL, the image will just show up without being clickable, which is fine.
This is VERY optional. If you include a value here, then the whole thing will be wrapped around a
<div> tag with an ID of whatever you specify here. I like to wrap my flash pieces around a DIV so that I can style them.