• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 587
  • Last Modified:

swf swap

Hi,
I am looking for a way to change Flash files when a user clicks on a link.
This is for a portfolio site. All of the SWF movies are the same size and go in the same position.
I would like to do this without reloading the page.
Can you offer a JavaScript (or other) solution?
Thanks,
Josh
0
Josh Fialkoff
Asked:
Josh Fialkoff
  • 6
  • 2
1 Solution
 
quincydudeCommented:
Is your swf embedded in a object tag?
If yes you can set the object with an id and get the object at runtime by

var myobject = document.getElementByid('myFlashObj')


and you can set the HTML of the object using

myobject.innerHTML
0
 
Josh FialkoffCEO/FounderAuthor Commented:
Thanks Dude!

This is the code for the Flash, so I believe so.

Here is a URL for the page: http://019d900.netsolhost.com/Wordpress/

-Josh

<div style="text-align: center; width:360px; height:250px; line-height:250px; margin-left: auto; background: #58585a;"><div id="swf4e5f1">This movie requires Flash Player 9</div></div>
 
<script type="text/javascript">
	swfobject.embedSWF("/Wordpress/wp-content/uploads/SampleSlides/home_slides.swf", "swf4e5f1", "360", "250", "9.0.0", "", {}, {wmode: "window", menu: "false", quality: "high", bgcolor: "#58585a"}, {});
</script>
			<li id="text-333168321" class="widget widget_text">						<div class="textwidget"><?php wp_swfobject_echo("/wp-content/uploads/SampleSlides/home_slides.swf", "360", "250"); ?></div>
		</li>
</div>

Open in new window

0
 
Josh FialkoffCEO/FounderAuthor Commented:
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Josh FialkoffCEO/FounderAuthor Commented:
I have tried that method here: http://019d900.netsolhost.com/Wordpress/wp-content/galleries/test.html.

Thanks,
Josh
0
 
Josh FialkoffCEO/FounderAuthor Commented:
Hi,

I found a solution to my problem.

This link did the trick: http://www.javascriptpost.com/javascript/how-dynamically-change-flash-movie-t11936.html.

Here's the code:
<HTML>
<HEAD>
<script>
function changeFlash(url){
var d=document;
(d.all)? d.all("flashMov1").movie = url :
d.embeds["flashMov2"].src = url;
}
 
</script>
</HEAD>
<BODY>
<object id=flashMov1
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="200" height="150">
<param name="movie" value="f1.swf">
<param name="quality" value="high">
 
<EMBED name=flashMov2 src="f1.swf" quality=high
WIDTH="200" HEIGHT="150"
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</object>
<p> </p>
<p><a href="javascript: changeFlash('f1.swf')">One </a></p>
<p><a href="javascript: changeFlash('f2.swf')">Two</a></p>
<p><a href="javascript: changeFlash('f3.swf')">Three</a></p>
 
</BODY>
</HTML>

Open in new window

0
 
Josh FialkoffCEO/FounderAuthor Commented:
This works well, but it does load a movie when the page loads.

How can I accomplish this?

Thanks!

-Josh
0
 
quincydudeCommented:
That piece of code looks fine.
Can you clarify your issue as I cannot understand what problem are you talking about.
0
 
Josh FialkoffCEO/FounderAuthor Commented:
The page was not loading a flash movie on load, but that is now working. The issue is resolved. Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now