PDA

View Full Version : getURL, "innerHTML" and IE == problem


gneier
03-17-2005, 03:56 PM
Folks,
Here's the problem I've identified, and have been unable to solve or find similiar posts.

The setup:

0. Using Internet Explorer 6

1. A flash SWF with "getURL('javascript:myFunc()')" on a series of mcs

2. The containing html page has a set of tabs, that change the innerHTML property of a separate <div id="uniqueID"></div> tag.


Scenerios:

1. clicking the movie clips (firing getURL("javascript..")) in the SWF results in expected behavior. (Good)

2. clicking the html tabs (resulting in new html getting generated) works as expected. However, returning to the SWF and clicking the movieclips will occationally result in the "javascript:.." code appearing in the browsers url field.. meaning the browser tries to open the code as a page instead of processing it as javascript. (Bad)

Anyone else run into this problem? It appears that manipulating the innerHTML of an object (unrelated to flash swf) causes the browser's javascript engine to fail to recognize flash's getURL() command

Am going to try slapping in FSCommand to see if I get the same behavior.

thank you,
Gary

tg
03-17-2005, 07:17 PM
try:
'javascript:myFunc();void(0);'

see if that helps.

gneier
03-17-2005, 08:11 PM
Tg,
Thanks for the idea.. I gave it a try, without any affect. Am working on narrowing the problem down further. Haven't been able to duplicate problem with a simple test swf/html. Will post what I find.
-Gary

gneier
03-17-2005, 09:21 PM
Folks,

Here's a demo of the problem:

http://www.angrykitty.org/gary/demo/demo.html

If you click the link, then the orange movieclip and back repeatedly, within 2-3 cycles the browser will go blank with either "javascript:test().." in the url or the original url.

Problem only occurs in IE6, not in IE5.01. IE5.5 displays the javascript:test(etc) in the url but the page doesn't change. Its been replicated on other folks computers.

The flash file has a single symbol instance (my_mc) and this code:

stop();
my_mc.onPress = function() { this._x++; this._y++; }
my_mc.onReleaseOutside = function() { this._x--; this._y--; }

my_mc.onRelease = function() {
this._x--; this._y--;
getURL("javascript:test();void(0)");
}

Any ideas would be appreciated.. Am going to try alternatives to innerHTML..

-gary

gneier
03-18-2005, 09:09 PM
The fix: is to add the "void(0);" to the HTML link... not (just) the flash link.

Thank you very much TJ.