Dynamically swap Flash movie without page reload

Posted on 2009-03-31
Last Modified: 2012-05-06
I am looking for a way to dynamically swap a Flash movie on this page:, without reloading the page.
Right now, I am using the code below, with JavaScript, but this is not working.


<title>Boston Advertising & Online Marketing Agency / Baldwin/Clancy/Rogan</title>

<link href="css/style.css" rel="stylesheet" type="text/css" />

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

<!-- Loading SWFObject from the Google repository; only works if you have an internet connection! -->

<script type="text/javascript" src=""></script>

<script type="text/javascript">

function loadSWF(url, targetID){

	//Check for existing SWF


		//replace object/element with a new div




	//Embed SWF

	if (swfobject.hasFlashPlayerVersion("7")) {


		var attributes = { data: url, width:"360", height:"250" };

		var params = {};

		var obj = swfobject.createSWF(attributes, params, targetID);




function isObject(targetID){

	var isFound = false;

	var el = document.getElementById(targetID);


	if(el && (el.nodeName === "OBJECT" || el.nodeName === "EMBED")){


		isFound = true;




	return isFound;


function replaceSwfWithEmptyDiv(targetID){

	var el = document.getElementById(targetID);




		var div = document.createElement("div");


		el.parentNode.insertBefore(div, el);


		//Remove the SWF



		//Give the new DIV the old element's ID

		div.setAttribute("id", targetID);






<div id="page">

<div id="wrap">

    <div id="header">


    <div id="nav">

       <ul class="nav block">

<li><a href="index.html"><strong>Home</strong></a></li>

<li><a href="portfolio.html"><strong>Portfolio</strong></a></li>

<li><a href="about.html"><strong>About</strong></a></li>

<li><a href="#"><strong>Contact</strong></a></li>



	<div id="content">

    	<div class="row">

		<div id="main">

		<h2>Portfolio: Samples </h2>

		<p>From complete, integrated branding programs to print ads, radio, TV, brochures and the Web, we do it all.</p>

		<p>More importantly, we love what we do. And we hope that it shows.  </p>



		<hr />

		<div class="row">

			<div class="leftlist">

			<p><a href="galleries/amerlux_slides.swf" onclick="loadSWF(this.href, 'flashcontent'); return false;">Amerlux Lighting</a></p>

			<p><a href="galleries/ecsb_slides.swf" onclick="loadSWF(this.href, 'flashcontent'); return false;">East Cambridge Savings Bank</a></p>



			<p>The Community Bank</p>




			<div class="gallerycontainer">

		      	  <script type="text/javascript">

AC_FL_RunContent( 'codebase',',0,19,0','width','360','height','550','title','Baldwin/Clancy/Rogan Advertising Portfolio','src','galleries/amerlux_slides','quality','high','pluginspage','','movie','galleries/amerlux_slides' ); //end AC code

</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,19,0" width="360" height="250" title="Baldwin/Clancy/Rogan Advertising Portfolio">

              <param name="movie" value="galleries/amerlux_slides.swf" />

              <param name="quality" value="high" />

              <embed src="galleries/amerlux_slides.swf" quality="high" pluginspage="" type="application/x-shockwave-flash" width="360" height="550"></embed>






    <div id="footer">

        <p>Worldwide Headquarters: 1040 Great Plain Avenue, Needham, MA. P: 781-433-9833</p>



		<div id="subfooter">

			<div id="satellite">

			<p>Satellite offices*: Malden, Lexington, Medfield, Maynard, Boston, and Easton</p>


			<div id="employees">

			<p>*aka employees' homes</p>




Open in new window

Question by:fialkoff
1 Comment

Accepted Solution

fialkoff earned 0 total points
ID: 24032744
I am closing this question because I have found a solution:


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now