Due to a patent ruling, plug-ins loaded using the embed, applet, and object tags will no longer be interactive
unless the user actually clicks on the plug-in object first: |
- Download the FlashObject JavaScript file by clicking the
following link:
- Unzip your recently downloaded flashobject.zip file to
the same location as your HTML page that will display your Flash animation:
I recomend that you simply place flashobject.js in the root folder of one of your websites and use the full address to access it. For instance, I use http://stevebraithwaite.com/flashobject.js
- Now, use the following Flash script to generate the HTML tags
required for displaying your animation. Enter your animation (SWF) file's
path relative to your HTML file, the width of your animation, and the height
of your animation and press the oversized Generate Code button:
- Copy and paste the generated code into the location in your
HTML file you want your animation to be displayed.
- If you want to upload the files to your server, just make sure to upload
your SWF, flashobject.js, and HTML file (if you need to). Double-check the paths to make sure
your SWF and FlashObject file paths still work online.
If everything worked out, you should be able to interact with embedded Flash
content without having to click on them first.
Information for Pages with Multiple Animations
First, if you are using the above Code Generator
for multiple animations on your page, be sure to only keep the first
appearance of the following code:
<script
type="text/javascript" src= "flashobject.js"></script>
While most browsers will cache multiple calls to the same file
(flashobject.js), some may not depending on what your site's caching settings
are.
Second, according to the code, your Flash animation will be placed wherever
the flashobject div tag is. If you have multiple animations using the same
generated code, make sure to change the reference to something else:
- <div id="flashcontent_02" style="width:
765px; height: 58px">
-
- <script type="text/javascript">
- var fo = new FlashObject("my_swf_file.swf", "animationName", "765", "58", "8", "#FFFFFF");
- fo.addParam("allowScriptAccess", "sameDomain");
- fo.addParam("quality", "high");
- fo.addParam("scale", "noscale");
- fo.addParam("loop", "false");
- fo.write("flashcontent_02");
- </script>
If you do not ensure that each FlashObject method points to a different div
name/location, you will find animations with duplicate div names loading in the
same place. You probably do not want that!
For the original and much more detailed article go to:

|