473,698 Members | 2,603 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to dynamically change a flash movie?

9 New Member
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("flashMov 1").movie = url :
d.embeds["flashMov2"].src = url;
}
</script>
</HEAD>

<BODY>
<object id=flashMov1
classid="clsid2 7CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=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="applicati on/x-shockwave-flash"
PLUGINSPAGE="ht tp://www.macromedia. com/go/getflashplayer" >
</EMBED>
</object>
<p></p>
<p><a href="javascrip t: changeFlash('f1 .swf')">One </a></p>
<p><a href="javascrip t: changeFlash('f2 .swf')">Two</a></p>
<p><a href="javascrip t: changeFlash('f3 .swf')">Three</a></p>
(from http://www.thescripts. com/forum/thread92820.htm l)

I am facing the above same problem!

Can somebody help?

Thanks in advance!
Feb 16 '07 #1
2 10606
acoder
16,027 Recognized Expert Moderator MVP
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 Recognized Expert Moderator MVP
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
5632
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 appears to be waiting for something, even though everything else is downloaded. If I set the movie to autoplay it runs fine but of course begins too early. This is the Macromedia script: function MM_controlShockwave(objStr,x,cmdName,frameNum) {...
2
13071
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> <script> function changeFlash(url){
3
7673
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 project so that I can use it as a screensaver. I was told that the easiest way would be to add a WebBrowser control to my Windows Form and then have it load the Flash movie, but I'm not sure how to do this. I have VS.Net 2005. Also, since I plan...
18
21585
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 depending on the innerwidth of the browser window. The point is when a flash movie is embedded for fullscreen usage (100%) it acts somewhat like a background, and won't cause scrollbars if the window is scaled to a smaller size than the 'actual' content...
0
1407
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 (alternative 1): The browser sends a request for the page. The php backend creates the first flash movie and sends it to the browser.
3
4985
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. http://g.bach.home.insightbb.com/movies.html I have a page set up on my website to view videos from various sites by creating html pages and creating links to view them inside an iframe. I'm getting tired of creating pages for every video that I find and it seems to make...
1
2321
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 describing the picture and it dynamically apply the changes to the existing movie. Can anyone help me out with the necessary steps/codes to effectively do this with ActionScripts/XML or any other format in Flash/SwishMax?
2
1949
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 the flash movie before save in database.............. thanks in advance
2
8077
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 did not understand some parameters totally in the HTML tag. These days when I was surfing the Internet I have found some comprehensive introduction to these two tags. I read it and conclude it with my own words; I think it will be useful to us, so I...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.