<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>unload issue &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/unload-issue/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>__flash__removeCallback problem on IE6</title>
		<link>/2009/06/24/__flash_removecallback-problem-on-ie6/</link>
		<comments>/2009/06/24/__flash_removecallback-problem-on-ie6/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 12:48:07 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[__flash__removeCallback]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[SWFObject]]></category>
		<category><![CDATA[unload issue]]></category>

		<guid isPermaLink="false">/?p=631</guid>
		<description><![CDATA[Every time the page unloads If there&#8217;s a flash movie into your page using the AMF protocol to speak with the other part of the site, there may be a bug under Internet Explorer version 6 &#8230; again. The AMF protocol stands for Action Message Format is simply JavaScript &#8211; Actionscript way to get connected. &#8230; <a href="/2009/06/24/__flash_removecallback-problem-on-ie6/" class="more-link">Continue reading <span class="screen-reader-text">__flash__removeCallback problem on IE6</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/02/10/ie-6-problem-with-flash-z-index/" rel="bookmark" title="IE 6 problem with flash z-index">IE 6 problem with flash z-index </a></li>
<li><a href="/2009/05/14/the-swfobject-method-createswf-problem/" rel="bookmark" title="The SWFObject method createSWF problem">The SWFObject method createSWF problem </a></li>
<li><a href="/2009/02/09/ie-externalinterface-communication-problem/" rel="bookmark" title="IE &#038; ExternalInterface communication problem">IE &#038; ExternalInterface communication problem </a></li>
<li><a href="/2009/12/18/whats-the-width-and-height-of-the-visible-part-of-my-browser/" rel="bookmark" title="What&#8217;s the width and height of the visible part of my browser?!">What&#8217;s the width and height of the visible part of my browser?! </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Every time the page unloads</h2>
<p>If there&#8217;s a flash movie into your page using the AMF protocol to speak with the other part of the site, there may be a bug under Internet Explorer version 6 &#8230; again. The AMF protocol stands for Action Message Format is simply JavaScript &#8211; Actionscript way to get connected. And it simply registers the callbacks from both sides. So there&#8217;s simply a object/embed pair in the HTML and a Flash movie using AMF, and IE6. Everything&#8217;s OK until leaving the page. On unload the window object the generated JavaScript code breaks and throws an error. Usually it&#8217;s something like that:</p>
<pre lang="actionscript">function __flash__removeCallback(instance, name) {
    ... here instance is given null under IE6
}</pre>
<h2>What if embed with some js library (SWFObject)</h2>
<p>Reading some forum posts it may be working if I was using a js/flash library such as SWFObject, but I don&#8217;t want such, because of one another JavaScript file loading and blocking the content. I just wanted the object/embed to be in my page.<span id="more-631"></span></p>
<h2>Easy to find a solution &#8211; difficult to set it up</h2>
<p>Beside the well known fact that this instance is null and there&#8217;s an error, I couldn&#8217;t make</p>
<pre lang="javascript">if (instance == null) escape this case ...</pre>
<p>because it&#8217;s a Flash Player generated source, which is untouchable.</p>
<h2>The clear way to the working site</h2>
<p>Well on unload of the window object you must remove all the object/embed that&#8217;s giving the problem simply by adding that chunk of code:</p>
<pre lang="javascript">
1. if (document.getElementById(id_of_the_flash_container) != null) {
2.    $(window).unload(function() {
3.         document.getElementById(id_of_the_flash_container).removeChild(document.getElementById(id_of_the_object_tag));
4.    });
5. }</pre>
<p>just replace both <strong>id_of_the_flash_container</strong>, which is some kind of a DIV tag, or other DOM element, and <strong>id_of_the_object_tag</strong>.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/02/10/ie-6-problem-with-flash-z-index/" rel="bookmark" title="IE 6 problem with flash z-index">IE 6 problem with flash z-index </a></li>
<li><a href="/2009/05/14/the-swfobject-method-createswf-problem/" rel="bookmark" title="The SWFObject method createSWF problem">The SWFObject method createSWF problem </a></li>
<li><a href="/2009/02/09/ie-externalinterface-communication-problem/" rel="bookmark" title="IE &#038; ExternalInterface communication problem">IE &#038; ExternalInterface communication problem </a></li>
<li><a href="/2009/12/18/whats-the-width-and-height-of-the-visible-part-of-my-browser/" rel="bookmark" title="What&#8217;s the width and height of the visible part of my browser?!">What&#8217;s the width and height of the visible part of my browser?! </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/06/24/__flash_removecallback-problem-on-ie6/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
