ace01 Posted July 20, 2006 Share Posted July 20, 2006 Hi,I have been using a javascript that allows me to swap images for a image gallery. Now I would like to do the samething, but I want to swap out flash files instead of images.can i change just a few things with this code to make it work with flash files?here is what i use to swap out images for my image gallery.//in the head tag<script language="JavaScript">function ChangePicture(imgSrc) { document.large_picture.src=imgSrc; }</script>//in the body<a href="javascript:ChangePicture('inter_gen_event/01.jpg');">01</a>thanksDave Link to comment https://forums.phpfreaks.com/topic/15142-javascript-swap-image-for-flash-files-help/ Share on other sites More sharing options...
GBS Posted July 26, 2006 Share Posted July 26, 2006 Hi,Try something like this:[code]<html><body><script language="JavaScript">function ChangePicture(imgSrc){var new_contains="<img id=\"large_picture\">";document.getElementById('contains').innerHTML=new_contains;document.getElementById('large_picture').src=imgSrc;}function ChangeFlash(flashSrc){var to_embed="<embed src=\""+flashSrc+"\" quality=\"high\" bgcolor=\"black\" align=\"center\" width=\"296\" height=\"110\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>'";document.getElementById('contains').innerHTML=to_embed;}</script>changing images,,<a href="javascript:ChangePicture('pics/flora10.jpg');">01</a><a href="javascript:ChangePicture('pics/flora9.jpg');">02</a>& flash files: <a href="javascript:ChangeFlash('bdm_player.swf');">03</a><div id="contains"><img id="large_picture" src="pics/flora9.jpg"></div></body></html>[/code]Hoping it helps,,l8tr, Link to comment https://forums.phpfreaks.com/topic/15142-javascript-swap-image-for-flash-files-help/#findComment-63965 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.