GeekZilla
Activating flash automatically with javascript
I find it really annoying when you go to a website and you have a flash movie or flash navigation and you have to click on the flash to activate it before you can start interacting with it. With a little bit of javascript you can automatically activate the movie so it becomes a seemless part of a website.
Here is how it works:
Include the javascript file you can find here:
http://blog.deconcept.com/swfobject/
Then put this on your page where the flash is.
<div id="flashcontent"> This text is replaced by the Flash movie. </div> <script type="text/javascript"> var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699"); so.write("flashcontent"); </script>
Thats it! If javascript is disabled then the content of the div is shown so you can put a useful message there.
There is a full breakdown of each part of the solution with further examples at the link above.
Author Andrew Clark
Web Application Developer
Add Comment
Tag Cloud
ajax
asp.net
atlas
authentication
Beta
c#
clr
CSS
dataset
datetime
dojo
dts
email
encryption
enum
event validation
excel
favicon
filesystem
fileupload
flash
fofo
form
full text search
fulltext
Gadget
gaming
gdi
GET
Globalization
javascript
navigation
PaulMarshall
POST
regex
security
seo
sitemap
sql
stored procedure
Strongly Typed Dataset
test
thanks
tips
url
utorrent
validation
vb
vb.net
Vista
VM
VMWare
vs2005
web2
webservice
windows forms
WSS
xml
xna
