Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Display issue of swf file in IE

23 views
Skip to first unread message

John_AIS

unread,
Jan 16, 2008, 3:59:53 PM1/16/08
to
I'm having a problem with directly viewing flash files in IE 7. When I click
on a url that is a direct link to a .swf file, I get a Javascript error. For
example, when I try to go to
http://www.library.cmu.edu/Libraries/etc/game2/game2.swf in my IE 7 browser, I
get a blank page and a Javascript error. I have my browser set to display
Javascript errors, and this is what it shows:

Line: 2
Char: 1
Error: Invalid character
Code: 0
URL: http://www.library.cmu.edu/Libraries/etc/game2/game2.swf

Embedded flash files on websites run fine. I've also removed and reinstalled
flash without any change. I don't believe that the problem is in Flash itself,
but rather in the way IE 7 chooses to display Flash objects.

So, programmer guy that I am, I wondered why I was getting a javascript error
when directly loading a flash file that shouldn't have any Javascript in it to
begin with. However, when I tried to look at the source code, I found that
"View Source" was greyed out and not available on the menu. When I tried to
save the file, that wasn't available on the menu either. Looking for a work
around that would allow me to see the page source code, I went into my security
settings for IE, and turned off scripting, and then reloaded the page.

This time, as the page reloaded, the Javascript was not executed, and I found
that I now could view the HTML source code for this page. Here's what the HTML
source for this page showed:

<html><head><script
src="res://mshtml.dll/objectembed_neutral.js"></script></head><body
objectSource="http://www.library.cmu.edu/Libraries/etc/game2/game2.swf"
onload="ObjectLoad();" leftmargin=0 topmargin=0 scroll=no> <form
id="objectDestination"></form> </body></html>

I noticed that the HTML loads a Javascript file
"res://mshtml.dll/objectembed_neutral.js". In researching this, I found that
the mshtml.dll is a DLL file for IE. To get a look at the Javascript in this
file, I built it into an HTML file as a link, and then when viewing the link in
IE 7, I right clicked on the link and used "Save Target" to save it to a file.
Here's the Javascript I found in it:

function ObjectLoad()
{
if ( objectDestination )
{
var bodyElement = objectDestination.parentElement;

if ( bodyElement.objectSource )
{
bodyElement.innerHTML = "<embed width=100% height=100%
fullscreen=yes>";
bodyElement.firstChild.src = bodyElement.objectSource;
}
}
}

In reviewing the code, everything looks great. This is legitimate code
designed to encapsulate objects like Flash in the browser. So why wasn't it
working? The original Javascript error was about an "invalid character".
Using a programmer's text editor (UltraEdit), I have the ability to look at
text in "hexadecimal mode". This gives me the ability to detect embedded
binary characters that are non-text and would be considered "invalid" if
embedded in the page source code. In looking at the objectembed_neutral.js
text, all looked fine. When looking at the HTML that IE creates, I found that
every other character in the HTML source code text is a NULL (hex 00). This is
not good or normal. In addition, it put "FF FE" at the start of the HTML it
produced. All of this was embedded and hidden in the text.

When Googling "objectembed_neutral", I get only 19 references, none of them
helpful. So why hasn't anyone noticed this problem?

Whenever we "View Source" in IE, it normally comes up in the Windows text
editor, "Notepad". I have UltraEdit set up so that it replaces Notepad as the
default text editor, so when I click on "View Source" in IE, the source code
for that page comes up in UltraEdit. This gives me the special ability to look
behind the text to view embedded binary characters. These nulls in the text of
the HTML that's being handed off to the browser as well as the two binary
characters at the start of the HTML is obviously what's creating the "invalid
character" error. Interestingly, if you cut and paste the HTML, the binary
characters are filtered out in the pasting process. It appears that the only
way to see these characters is to set up an alternative editor that shows
binary characters as your replacement for notepad, and then to have IE send the
raw HTML directly to that editor.

So now we know that when loading a .swf file in IE 7, it has internal handling
that can create faulty HTML with binary characters embedded in the text. The
question is, why is this not happening to everyone? This could be a bug in IE
7, but numerous windows updates haven't fixed the problem. One guess is that
it may have something to do with a virus that's modified an IE DLL file, and
now it's misbehaving. An alternative guess is that may have something to do
with the fact that my machine is running on the Windows XP 64 bit operating
system. That means that the DLL files that IE uses for 64 bit may be different
than what runs in a XP 32 bit environment, and could have a bug that's not
being noticed.

I look forward to your thoughts.

Regards,

John

quibble...@gmail.com

unread,
Jan 21, 2008, 2:06:06 AM1/21/08
to
Could be simply that you've got 'Allow active content to run files on
my computer' ticked as a security option under tools->advanced options
in ie, if it is try unticking that and giving it a go, as with this
setting on it will dissallow the res: include.

Nurtur8r

unread,
Jan 21, 2008, 11:27:33 AM1/21/08
to
I am having pretty much the same problem. Here is the environment, All CS3,
Flash and Dreamweaver, built the .swf in flash, placed it in the page using
Dreamweaver and it all works great on my Vista 32 computer when I "preview in
browser". But, when I upload the page to the website, the Flash component won't
even display blank and it returns the same results whether I use IE6 or IE7.
Also, on another site, when I agreed to have Dreamweaver make some "correction"
it wanted to make to be more compatible with current browsers, (I don't have
the exact verbiage on that alert), the .swf files in the uploaded pages that
contained the edits and the "Dreamweaver Correction" quite working. Once I
restored the original files back to the website, the .swf files worked fine and
now I simply do not accept the Dreamweaver change suggestion. I am not as
experienced as you in programming, etc. but thought some of these clues at the
scene of the crime might help. I'd love to hear your thoughts.

Shade

unread,
Feb 1, 2008, 1:12:41 PM2/1/08
to

I can confirm your solution. I had the exact same symptoms, and I
simply unchecked that option, and it works.

Is this a bug?

I don't understand why this setting would prevent looking at SWF's
directly in the browser. In fact, it would seem that if anything,
viewing SWF's should be ENABLED by checking this option (in that
a .swf file could be considered active content on your computer, for
instance).

Marcos Frijoles

unread,
Feb 26, 2008, 1:33:07 PM2/26/08
to
Hi-

Did you ever resolve this issue? I have been experiencing pretty much the same
thing. Please forgive my ignorance and weak technical background.

I am trying to run an .SWF file using a simple HTML A Link command rather than
as an embedded object.

Here is the line of code that I am trying to run:

<a href="728_Medisoft.swf">Medisoft Flash Demo for FREE!</a>

I had a different website published for several years using virtually the same
.SWF file and the same command with no problems. Now I have a new web site on a
different hosting platform using virtually the same code. When I attempt to run
this .SWF by clicking on the link IE7 displays a blank (white) page and I get
two page errors (displayed in lower left corner of IE). The errors are similar
to what you reported:

Line: 1
Char: 1
Error: Object Expected
Code: 0
URL: Medicalsoftwaretools.com/728_Medisoft.swf

Line: 2
Char: 1
Error: Invalid character
Code: 0

URL: Medicalsoftwaretools.com/728_Medisoft.swf

When I view the source for the page attempting to run the .SWF I get this:

<html><head><script
src="res://mshtml.dll/objectembed_neutral.js"></script></head><body

objectSource="http://www.medicalsoftwaretools.com/Medisoft_Demo_Video/728_Mediso
ft.swf" onload="ObjectLoad();" leftmargin=0 topmargin=0 scroll=no> <form

id="objectDestination"></form> </body></html>

I don?t remember using any resource files when I had this working before. I
have not been able to locate a file called objectembed_neutral.js.

Also I contacted the support folks at my ISP host and was told that their
platform supports running .SWF files. I was told that if it isn?t working than
it is a problem on the local box. I am able to run the same demo from the web
sites of two other companies on two boxes I have. I looked at their code and
they are using the same A Link code to run the demo. My page fails on both of
my boxes.

I have not been able to locate any documentation on running Flash using the A
Link HTML command. I would be curious if the embedded object method is better
and why? I was hoping to make this easy and just do it like it worked before.
So much for easy?

Any help would be appreciated? I?ve fallen and I can?t get up.


Marcos Frijoles

unread,
Feb 26, 2008, 1:37:36 PM2/26/08
to
Opps...

I have been working on this issue for several hours trying various things so
please overlook the inconsistancy above between the
objectSource="http://www.medicalsoftwaretools.com/Medisoft_Demo_Video/728_Mediso
ft.swf" and the error message URL: Medicalsoftwaretools.com/728_Medisoft.swf.

glennkcl

unread,
Mar 20, 2008, 9:01:53 PM3/20/08
to
Ok guys,

I've been having this problem as well, but was able to make some headway with
the problem after changing a setting in IE. I'm not a developer so I don't know
what to make of this, but hopefully it will lead someone else down the path of
enlightenment.

Go to internet options and click on the advanced tab. Scroll down to "Allow
active content to run in files on My Computer" and make sure it is NOT CHECKED.
After this, I ran my page again and my Flash object came up nice and pretty.

It was initially checked for me, but when I restored the default settings, it
unchecked itself. Funny thing is that I don't ever remember adjusting these
settings.

Is there a guru who can provide an explaination?

-Glenn

ms_troylee

unread,
Mar 23, 2008, 9:54:09 AM3/23/08
to
Hey...

I'm having the same problem, just tried your solution but no luck... what java
script do you have and is it in a script folder with in your main site folder?

I'm new to this and completely lost, any ideas would be much appreciated!!

Cheers troylee...

WildWindNL

unread,
Mar 28, 2008, 2:41:40 AM3/28/08
to
Hey guys I found this site which I think discusses the problem:

http://support.microsoft.com/default.aspx/kb/934366

0 new messages