473,903 Members | 5,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically loading swf with innerHTML

35 New Member
I'm not really a IE (Internet Explorer) basher but sometimes it does get really trying!

I'm trying to dynamically load a swf (Flash) file into a div using innerHTML. 2 versions of IE won't do it properly:

MSIE 6.0 on Windows
MSIE 5.5 on Windows

Both don't load anything...

Does anyone know what on earth could be the problem? It works flawlessly with almost every other browser (including later versions of EI) and on all platforms (Linux, Mac and Windows)!

Please help. I'm inclined to join the anti-IE bandwagon really soon cos this has been driving me nuts!

Here is my code below. Note: other innerHTML calls work fine with both MSIE6.0 and 5.5

Expand|Select|Wrap|Line Numbers
  1.     var swfContent = 
  2.  
  3.         "<object width='245' height='75' id='mySwf'>" +
  4.             "<param name=movie value='mySwf.swf'>" +
  5.             "<param name=quality value=high>" +
  6.             "<param name=wmode value=transparent>" +
  7.  
  8.             "<embed src='mySwf.swf' quality=high wmode=transparent width='245' height='75' name='mySwf' type='application/x-shockwave-flash'>"+
  9.             "</embed>" +
  10.         "</object>";
  11.  
  12.  
  13.     document.getElementById("swfDiv").innerHTML = swfContent;
  14.  
Mar 28 '07 #1
6 19441
iam_clint
1,208 Recognized Expert Top Contributor
why don't you just change the source and not the entire html?

or create the object and append it to the div
Mar 28 '07 #2
carllucas
35 New Member
I need the flash object to be reloaded with a fresh flash movie each time a user calls a function and I need some of the flash variables in the object declaration to change. This is why I need the object to be dynamically loaded and placed into a div each time.

This system work perfectly excpet with MSIE5.5 and MSIE 6.0 which won't load any flash movie.

Perhaps someone can put my code in a function and test it on their system for me and see if they can figure out why this is so.

Thanks
Mar 28 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
I don't work with Flash, but could you not just change the parameters as well as the src each time?
Mar 29 '07 #4
carllucas
35 New Member
Okay then... I'm willing to give that a try. How do you change the <OBJECT> parameters dynamically? Is it like with <FORM> (i.e.: document.object 1.param1.value = newValue) ?

Will this then automatically load a new movie?

I'm going to go give this a try. If I'm heading in the wrong direction please tell me. But (and not to sound stuborn here...) i still don't understand why the original method wouldn't work in MSIE5.5 and MSIE6.0 since innerHTML works and Flash objects work? It would still be good to know for future why this is a problem in the first place.
Mar 29 '07 #5
carllucas
35 New Member
Problem seems to be solved...

This solution did the trick... compatibility issues as always...
http://www.thescripts.com/forum/thread603298.html
Mar 29 '07 #6
acoder
16,027 Recognized Expert Moderator MVP
Heh? Was that me?

Glad you got it working.
Mar 30 '07 #7

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

Similar topics

10
2209
by: Randy Webb | last post by:
This page: http://www.hikksworld.com/loadJSFiles/ Is one where I was testing the ability of browsers that can/can't dynamically load a JS file with one of the three methods: 1)Changing the src property of a script tag. 2)Inserting a script src="" tag in a div via innerHTML 3)Using document.createElement to add a script element. The fourth method on the page is writing a script tag to a layer, and to the best of my knowledge it only...
1
5026
by: Benjamin | last post by:
Hi, I'm currently writing a Web Services that interacts with a database. To allow me to use not just one database provider (for example, I could use MS Access, SQL Server or MySQL), the Web Service dynamically loads up an assembly that implements an Interface I called IDatabase. To load the assembly and create an object, I wrote this function: private IDatabase LoadDatabasePlugin( string assemblyFile, string
1
2313
by: José Joye | last post by:
Hello, I'm playing around with dynamically loading user controls ...and having problems I created a really simple userControl (in fact contains a plain text box) and placed it into the MyTestCtrl2.ascx file. In an aspx file I placed the following in the Page_Load method:
5
2787
by: footballhead | last post by:
I have a site that has MANY different clothing categories. I have a page set up for displaying the products (productsearch.aspx) when a user clicks one of the category links on the navigation menu. I would like to have a different user control that gets loaded as a sub-header for each category (ie, tee shirts, shoes, backpacks, etc.) The category user controls include images and links to refined searches specific to each category. So...
5
6100
by: Jay Douglas | last post by:
I have a set of pages that inherit from a base class in the App_Code folder. The class looks something like: public class MyBaseClass : System.Web.UI.Page In various stages of the life cycle I need to add user controls to the page control container. i.e: protected override void OnInit(EventArgs e) {
6
6886
by: Dan Dorey | last post by:
I actually have two questions here, but I'll start by giving an outline of what I'm trying to do. I'm building an app with a simple plugin architecture (all in the same app domain). I have each plugin in a separate sub-dir inside a "Plugins" directory. Each plugin consists of at least two DLLs (a controller and a driver). However, most drivers also rely on other external DLLs. In one particular case this dependency is to a C++ DLL...
1
1852
by: Bob Rock | last post by:
Hello, I'm new to ASP.NET and I've been looking into the topic of dynamically loading (typically accomplished with a LoadControl followed by a MyControl.Controls.Add()) both user controls and asp.net web controls. I searched for articles on the internet and in the end I must say that I'm confused. I read about issues related to: a.. events not firing
2
3131
by: Smithers | last post by:
Using 3.5, I am stuck in attempting to: 1. Dynamically load an assembly 2. Instantiate a class from that assembly (the client code is in a different namespace than the namespace of the dynamically loaded assembly) so far so good (per my code below)... but here is where I'm getting hung up: 3. Call methods of that type (see comments in my code) If the types in the dynamically loaded assembly were in the same namespace
20
4317
by: Nickolai Leschov | last post by:
Hello all, I am programming an embedded controller that has a 'C' library for using its system functions (I/O, timers, all the specific devices). The supplied library has .LIB and .H files. How can I dynamically load a LIB file and access all its functions? Surely someone has solved similar task? My intention is to use a Forth system for programming the controller,
0
9853
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
11293
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
10882
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
10989
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
10504
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...
1
8057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5899
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4315
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3327
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.