Can anyone help me find tutorials/help pages on how to use javascript to swap out content with flash. I'm trying to integrate a website using that and can't find anything I'm looking for!
Can anyone help me find tutorials/help pages on how to use javascript to swap out content with flash. I'm trying to integrate a website using that and can't find anything I'm looking for!
you can do this without javascript I think. why do you need it.
I made a navigation in flash but the website itself I am not coding in flash so I was told that I can use javascript to swap content in the div for the flash navigation.
There are other alternatives, but the standard that I've seen used most is swfObject. Very stable. Search-engine friendly. Easy to use. It allows you to put in alternate content that gets swapped out if Flash is available.
http://blog.deconcept.com/swfobject/
What is the best way to do that then? Is javascript not recommended?
Personally, I would prefer JavaScript over Flash, because with Flash for people without Adobe Flash Player (or equivalent) they can't navigate through your site.
DD has a couple Content Switch scripts, here's one of them:
http://www.dynamicdrive.com/dynamici...tabcontent.htm
- Mike
Again, the best way I know to do this is to use the javascript found atI made a navigation in flash but the website itself I am not coding in flash so I was told that I can use javascript to swap content in the div for the flash navigation.
http://blog.deconcept.com/swfobject/
First, put the swfobject.js script on your server.
In the head of your HTML page, link the script to your document like this:
Make a <div> that will hold your flash menu. This can be an empty <div> or it can have content (perhaps an HTML version of your menu):Code:<script type="text/javascript" src="swfobject.js"></script>
After that <div>, add the javascript function call:Code:<div id="flashcontent"> This text is replaced by the Flash movie. </div>
The parameter "movie.swf" should be the path to your swf movie. "mymovie" is the id that will be assigned to the object or embed tag. the next two are the width and height, followed by the Flash version that should be detected, and finally the background color. There is a lot more info about it on the link above.Code:<script type="text/javascript"> var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#FFFFFF"); so.write("flashcontent"); </script>
This code will insert your flash movie into your HTML file if the required Flash version is present. If not, people will just see whatever HTML you had in the <div> to start with.
Whoa... never seen anything like that before. That's a pretty snazzy script. I don't particularly like all the browser detection though, but I guess that's necessary in some cases.
- Mike
But what about the people with JS turned off...
they cant veiw the movie, assume it isn't there and move onto another site.
To be safe, have noscript tags in the div with the movie.
If people have js turned off, they just see the alternate content provided in the <div> (if any). If it were a menu like this one, I'd just provide an HTML menu there. In a lot of cases, people who don't have Flash or have JS turned off won't even know that the Flash was supposed to be there.But what about the people with JS turned off...
Plus, search engines see your alternate HTML content even though most users see the Flash.
Bookmarks