473,326 Members | 2,680 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,326 software developers and data experts.

Dynamically loading swf with innerHTML

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 19419
iam_clint
1,208 Expert 1GB
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
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 Expert Mod 8TB
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
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.object1.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
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 Expert Mod 8TB
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
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...
1
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...
1
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...
5
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....
5
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...
6
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...
1
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...
2
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...
20
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. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.