473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How to dynamically change a flash movie?

Hi all,

I want to dynamically change a flash movie in an html page. Following
code is working fine in IE, but netscape 4 and 6 it is not working.
Can any one rectify the error:

<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="clsid27CDB6E-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>
(from http://www.thescripts.com/forum/thread92820.html)

I am facing the above same problem!

Can somebody help?

Thanks in advance!
Feb 16 '07 #1
2 10592
acoder
16,027 Expert Mod 8TB
Don't use document.all to detect IE. Give the object an id and use:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(id).src=url;
and in IE, use the movie parameter to change the source (as you are already doing).
Feb 16 '07 #2
acoder
16,027 Expert Mod 8TB
What you use depends on whether you use OBJECT or EMBED for your flash player. See this link for all the options.

Also, you might consider using SWFObject for detect and embed your Flash Player.
Feb 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: btopenworld | last post by:
I have a Flash movie with parameter 'autoplay' set to false. The movie is started using a Macromedia javascript function via onload. This is OK in IE but Netscape 6 doesn't run the movie - it...
2
by: kiran | last post by:
Hi all, I want to dynamically change a flash movie in an html page. Following code is working fine in IE, but netscape 4 and 6 it is not working. Can any one rectify the error: <HTML> <HEAD>...
3
by: VMI | last post by:
I asked this question some time ago, and I received a reply, but I never followed up on the suggestion. That's why I'm posting again... I'm trying to add a Macromedia Flash movie to my C# windows...
18
by: gconrads | last post by:
OK, today is my twofer special on js questions. BTW: the method used here is working in Firefox I'm working on a script that switches the width of a Flash movie between 100% and 812 pixels...
0
by: CptDondo | last post by:
I am trying to get started on a page which uses a short flash movie to show status. The flash movie itself is only a few seconds long - say 15 seconds. What I want is something like this...
3
by: synergy_711 | last post by:
I feel like this should be fairly easy but I have been struggling with this for sometime. I have not been able to find someone who's had the same problem as mine yet. ...
1
by: onye52000 | last post by:
Hi. I want to be able to change the text and pictures of a flash movie from a control panel on the same running flash movie. I will need to upload pictures on the movie with the necessary text...
2
by: vimal.424 | last post by:
Dear All, Please help me......... Please tell me how can we store the flash movie in data base,after storing how can we retreive flash movie from data base. I want have to do, also the preview...
2
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.