<?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>embed &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/embed/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>object and embed tag position in IE</title>
		<link>/2009/10/30/object-and-embed-tag-position-in-ie/</link>
		<comments>/2009/10/30/object-and-embed-tag-position-in-ie/#respond</comments>
		<pubDate>Fri, 30 Oct 2009 19:00:38 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[object]]></category>

		<guid isPermaLink="false">/?p=748</guid>
		<description><![CDATA[What is OK? If you&#8217;ve written at least once the OBJECT and EMBED tags, without copy/paste you may have been noticed that the place of the EMBED tag is a bit strange. Actually after the OBJECT tag, comes the PARAM sequence, that simply defines different parameters for the flash movie. And what looks strange? The &#8230; <a href="/2009/10/30/object-and-embed-tag-position-in-ie/" class="more-link">Continue reading <span class="screen-reader-text">object and embed tag position in IE</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/01/07/object-forget-about-embed-tag/" rel="bookmark" title="OBJECT &#038; &#8230; forget about EMBED tag!">OBJECT &#038; &#8230; forget about EMBED tag! </a></li>
<li><a href="/2009/02/22/html-object-and-embed-tags/" rel="bookmark" title="Html object &#038; embed tags">Html object &#038; embed tags </a></li>
<li><a href="/2009/02/23/object-and-embed-tags-revealed/" rel="bookmark" title="object and embed tags revealed">object and embed tags revealed </a></li>
<li><a href="/2009/06/08/a-tag-doesnt-apply-hover-on-ie6/" rel="bookmark" title="a tag doesn&#8217;t apply hover on IE6">a tag doesn&#8217;t apply hover on IE6 </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>What is OK?</h2>
<p>If you&#8217;ve written at least once the OBJECT and EMBED tags, without copy/paste you may have been noticed that the place of the EMBED tag is a bit strange. Actually after the OBJECT tag, comes the PARAM sequence, that simply defines different parameters for the flash movie.</p>
<h2>And what looks strange?</h2>
<p>The strange thing in all this is that the EMBED tag, which in fact is only one, instead of the case with all the parameters of the OBJECT, is displayed just before the closing of the OJBECT tag.</p>
<h2>Experimenting &#8230;</h2>
<p>What if the embed tag is outside of the OBJECT opening and closing tags. Actually only IE understands this as a problem. Than it displays the move twice!</p>
<p>That&#8217;s why the place of the EMBED is just before closing the OBJECT tag. In that case MSIE doesn&#8217;t &#8220;see&#8221; the EMBED and displays everything correctly!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/01/07/object-forget-about-embed-tag/" rel="bookmark" title="OBJECT &#038; &#8230; forget about EMBED tag!">OBJECT &#038; &#8230; forget about EMBED tag! </a></li>
<li><a href="/2009/02/22/html-object-and-embed-tags/" rel="bookmark" title="Html object &#038; embed tags">Html object &#038; embed tags </a></li>
<li><a href="/2009/02/23/object-and-embed-tags-revealed/" rel="bookmark" title="object and embed tags revealed">object and embed tags revealed </a></li>
<li><a href="/2009/06/08/a-tag-doesnt-apply-hover-on-ie6/" rel="bookmark" title="a tag doesn&#8217;t apply hover on IE6">a tag doesn&#8217;t apply hover on IE6 </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/10/30/object-and-embed-tag-position-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExternalInterface from JavaScript to IE/Firefox</title>
		<link>/2009/07/08/externalinterface-from-javascript-to-ie-firefox/</link>
		<comments>/2009/07/08/externalinterface-from-javascript-to-ie-firefox/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 06:53:53 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[flex 3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[object]]></category>

		<guid isPermaLink="false">/?p=660</guid>
		<description><![CDATA[ExternalInterface communication with JavaScript The most simple way to describe the case is as if you have the ExternalInterface addCallback in the Flex application like that: flex.mxml ExternalInterface.addCallback("jsFunc", flexFunc); public flexFunc() : void { ... } and in the javascript code you&#8217;ve something like that: file.js function getSwf(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return &#8230; <a href="/2009/07/08/externalinterface-from-javascript-to-ie-firefox/" class="more-link">Continue reading <span class="screen-reader-text">ExternalInterface from JavaScript to IE/Firefox</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/03/09/flex-javascript-communcation-example/" rel="bookmark" title="Flex Javascript communcation example">Flex Javascript communcation example </a></li>
<li><a href="/2009/10/28/tips-and-tricks-in-externalinterface-communication/" rel="bookmark" title="Tips and tricks in ExternalInterface communication!">Tips and tricks in ExternalInterface communication! </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/10/29/passing-objects-with-externalinterface-from-js-to-flex/" rel="bookmark" title="Passing objects with ExternalInterface from JS to Flex">Passing objects with ExternalInterface from JS to Flex </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>ExternalInterface communication with JavaScript</h2>
<p>The most simple way to describe the case is as if you have the ExternalInterface addCallback in the Flex application like that:</p>
<p><strong>flex.mxml</strong></p>
<blockquote>
<pre>ExternalInterface.addCallback("jsFunc", flexFunc);

public flexFunc() : void
{ ... }</pre>
</blockquote>
<p>and in the javascript code you&#8217;ve something like that:<span id="more-660"></span></p>
<p><strong>file.js</strong></p>
<blockquote>
<pre>function getSwf(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
         return window[movieName];
    } else{
         return document[movieName];
    }
}

getSwf('movie').jsFunc();</pre>
</blockquote>
<p>that will execute the <strong>flexFunc</strong> in the flex app.</p>
<h2>Important!</h2>
<p>is very important to have the object/embed tag correct:</p>
<blockquote>
<pre>&lt;object classid="clsid:d27cdb6 ....
&lt;param name="name" value="movie" /&gt;
&lt;param name="allowFullScreen" value="true" /&gt;
&lt;param name="AllowScriptAccess" value="always" /&gt;
&lt;param name="wmode" value="transparent" /&gt;
&lt;param name="flashVars" /&gt;
&lt;param name="src" value="movie.swf" /&gt;
&lt;embed ... name="movie"&gt;&lt;/embed&gt;
&lt;/object&gt;</pre>
</blockquote>
<h2>That doesn&#8217;t work? Where&#8217;s the bug?</h2>
<p>Even it&#8217;s not so clear the bug is present. The getSwf function gets the window[moviename], or document[moviename] depending of which browser is used. But the problem is that both object and embed tags have same name and the selected object is not one but two.</p>
<h2>So there&#8217;s a simple patch</h2>
<p>Name the object embed tags with different names, i.e.</p>
<blockquote>
<pre>&lt;object classid="clsid:d27cdb6e-ae6d-11 ...&gt;
&lt;param name="name" value="movieie" /&gt;
&lt;param name="allowFullScreen" value="true" /&gt;
&lt;param name="AllowScriptAccess" value="always" /&gt;
&lt;param name="wmode" value="transparent" /&gt;
&lt;param name="flashVars" /&gt;
&lt;param name="src" value="movie.swf" /&gt;
&lt;embed ... name="movieie"&gt;&lt;/embed&gt;
&lt;/object&gt;</pre>
</blockquote>
<p>now they are named movieie (for IE) and movieff  (for Firefox) and we must to change a bit the getSwf function like that:</p>
<blockquote>
<pre>function getSwf(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
         return window[movieName + 'ie'];
    } else{
         return document[movieName + 'ff'];
    }
}

getSwf('movie').jsFunc();</pre>
</blockquote>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/03/09/flex-javascript-communcation-example/" rel="bookmark" title="Flex Javascript communcation example">Flex Javascript communcation example </a></li>
<li><a href="/2009/10/28/tips-and-tricks-in-externalinterface-communication/" rel="bookmark" title="Tips and tricks in ExternalInterface communication!">Tips and tricks in ExternalInterface communication! </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/10/29/passing-objects-with-externalinterface-from-js-to-flex/" rel="bookmark" title="Passing objects with ExternalInterface from JS to Flex">Passing objects with ExternalInterface from JS to Flex </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/07/08/externalinterface-from-javascript-to-ie-firefox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>StageDisplayState.FULL_SCREEN under IE</title>
		<link>/2009/03/10/stagedisplaystate-full-screen-under-ie/</link>
		<comments>/2009/03/10/stagedisplaystate-full-screen-under-ie/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 06:51:59 +0000</pubDate>
		<dc:creator><![CDATA[stoimen]]></dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[flex 3]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">/?p=324</guid>
		<description><![CDATA[Why the fullscreen of flash movies don't work under IE? Here's the answer<div class='yarpp-related-rss'>

Related posts:<ol>
<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/07/08/externalinterface-from-javascript-to-ie-firefox/" rel="bookmark" title="ExternalInterface from JavaScript to IE/Firefox">ExternalInterface from JavaScript to IE/Firefox </a></li>
<li><a href="/2009/10/30/object-and-embed-tag-position-in-ie/" rel="bookmark" title="object and embed tag position in IE">object and embed tag position in IE </a></li>
<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>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>If someone wanders why the fullscreen doesn&#8217;t work correctly under IE, after calling StageDisplayState.FULL_SCREEN in Flex &#8211; there&#8217;s the answer. Just don&#8217;t forget to add</p>
<blockquote><p><span style="color: #808080;"><em>&lt;param name=&#8221;allowFullScreen&#8221; value=&#8221;true&#8221;&gt;</em></span></p></blockquote>
<p>parameter of the object tag. You may also set <em><strong>allowFullScreen=&#8221;true&#8221;</strong></em> of embed tag.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<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/07/08/externalinterface-from-javascript-to-ie-firefox/" rel="bookmark" title="ExternalInterface from JavaScript to IE/Firefox">ExternalInterface from JavaScript to IE/Firefox </a></li>
<li><a href="/2009/10/30/object-and-embed-tag-position-in-ie/" rel="bookmark" title="object and embed tag position in IE">object and embed tag position in IE </a></li>
<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>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/03/10/stagedisplaystate-full-screen-under-ie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex 3 import swf symbols</title>
		<link>/2009/03/05/flex-3-import-swf-symbols/</link>
		<comments>/2009/03/05/flex-3-import-swf-symbols/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 07:30:35 +0000</pubDate>
		<dc:creator><![CDATA[stoimen]]></dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[flex 3]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[movie clip]]></category>
		<category><![CDATA[symbol]]></category>

		<guid isPermaLink="false">/?p=291</guid>
		<description><![CDATA[Embedding a .swf file into Flex application can be difficult sometimes. Learn how to solve this issue.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/03/01/flex-3-custom-datechooser-2/" rel="bookmark" title="Flex 3 Custom DateChooser">Flex 3 Custom DateChooser </a></li>
<li><a href="/2009/03/18/flex-3-text-editor/" rel="bookmark" title="Flex 3 text editor">Flex 3 text editor </a></li>
<li><a href="/2009/03/15/flex-3-bitmap-with-round-corners/" rel="bookmark" title="Flex 3 bitmap with round corners">Flex 3 bitmap with round corners </a></li>
<li><a href="/2009/02/06/flex-3-custom-preloader/" rel="bookmark" title="Flex 3 Custom Preloader">Flex 3 Custom Preloader </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;d like to embed a .swf file into your Flex 3 application you&#8217;ll probably get into several little problems. The simple task of embedding is clear and well documented in the web. Let&#8217;s assume we&#8217;ve to MovieClip symbols into a single .swf file. What we like to do is to access this two separate symbols within the Flex applications as MovieClip.</p>
<figure id="attachment_292" style="width: 300px" class="wp-caption alignnone"><a href="/wp-content/uploads/2009/03/embed_swf_symbols_1.png"><img class="size-medium wp-image-292" title="embed_swf_symbols_1" src="/wp-content/uploads/2009/03/embed_swf_symbols_1-300x247.png" alt="make a movie clip in your flash" width="300" height="247" srcset="/wp-content/uploads/2009/03/embed_swf_symbols_1-300x247.png 300w, /wp-content/uploads/2009/03/embed_swf_symbols_1.png 796w" sizes="(max-width: 300px) 100vw, 300px" /></a><figcaption class="wp-caption-text">Make a new MovieClip symbol in your Flash</figcaption></figure>
<p>Make the .swf sample file with both symbols inside. In general it&#8217;s not that hard, just put this into your Flex application code:</p>
<p><code>[Embed(source="embed.swf", symbol="blue")]<br />
private var blue:Class;</code></p>
<p>[Embed(source=&#8221;embed.swf, symbol=&#8221;red&#8221;)]<br />
private var red:Class</p>
<p>Note that you&#8217;ve embed.swf file, which has to be in the same folder as the main .swf of the Flex app, and two symbols named red and blue for the sample. Be very careful when exporting the symbols from the .swf file. Do not forget to export them for actionscript.</p>
<figure id="attachment_293" style="width: 295px" class="wp-caption alignnone"><a href="/wp-content/uploads/2009/03/embed_swf_symbols_2.png"><img class="size-medium wp-image-293" title="embed_swf_symbols_2" src="/wp-content/uploads/2009/03/embed_swf_symbols_2-295x300.png" alt="Don't forget to export the .swf MovieClip for actionscript" width="295" height="300" srcset="/wp-content/uploads/2009/03/embed_swf_symbols_2-295x300.png 295w, /wp-content/uploads/2009/03/embed_swf_symbols_2.png 676w" sizes="(max-width: 295px) 100vw, 295px" /></a><figcaption class="wp-caption-text">Don&#39;t forget to export the .swf MovieClip for actionscript</figcaption></figure>
<p>If not exported like that, you&#8217;ll have trouble accessing them from the Flex app, and that&#8217;s the first problem you can have here.</p>
<figure id="attachment_294" style="width: 300px" class="wp-caption alignnone"><a href="/wp-content/uploads/2009/03/embed_swf_symbols_3.png"><img class="size-medium wp-image-294" title="embed_swf_symbols_3" src="/wp-content/uploads/2009/03/embed_swf_symbols_3-300x212.png" alt="Set the name of the MovieClip exactly as you wish to appear in your Flex application" width="300" height="212" srcset="/wp-content/uploads/2009/03/embed_swf_symbols_3-300x212.png 300w, /wp-content/uploads/2009/03/embed_swf_symbols_3.png 577w" sizes="(max-width: 300px) 100vw, 300px" /></a><figcaption class="wp-caption-text">Set the name of the MovieClip exactly as you wish to appear in your Flex application</figcaption></figure>
<p>The rest you have to do is to add this two lines of code in Flex:</p>
<p><code>var mc:MovieClip = new blue();<br />
this.addChild(mc);</code></p>
<p>Note that the last line can have something else than &#8216;this&#8217; if there&#8217;s other element to become parent of the imported MovieClip symbol. Here comes the first major problem. As <a title="www.airtightinteractive.com" href="http://www.airtightinteractive.com/news/?p=112" target="_blank">www.airtightinteractive.com</a> describes this technique does not work every time:</p>
<blockquote><p><em>Sometimes when you do this you will get the following error: </em></p>
<p><em><strong>TypeError: Error #1034: Type Coercion failed: cannot convert app_red@12510d1 to flash.display.MovieClip.</strong></em></p></blockquote>
<p>And the author shares his solution which is to add at least 2 keyframes for both movie clips, so that they can be visible as movie clips, if not they will remain visible only as Sprites.</p>
<p>I&#8217;m not as conviced this is the right answer of the question and the right solution. I&#8217;ve experimented with 1 or 2 keyframes and still have the same problem in Flex even if i cast the symbols as Sprite, not MovieClip:</p>
<p><code><span style="text-decoration: line-through;">var mc:MovieClip = new blue();</span><br />
var mc:Sprite = new blue();</code></p>
<p>The solution from Adobes for me is not suficient, cause the movie clips we import (embed) does not serve as images but more like movie clips, which was the task from the beggining. And that&#8217;s what <a title="adobe" href="http://livedocs.adobe.com/flex/3/html/help.html?content=embed_4.html" target="_blank">Adobe</a> says:</p>
<blockquote><p><em>Flex fully supports embedding Flash SWF files. You can embed different types of SWF files.</em><br />
<em>&#8230;</em><br />
<em>To reference a symbol, you specify the symbol parameter:</em><br />
<em>[Embed(source=&#8217;SWFFileName.swf&#8217;, symbol=&#8217;symbolName&#8217;)]</em></p></blockquote>
<p>And again read carefully the note in the Adobe&#8217;s site:</p>
<blockquote><p><em><strong>Note</strong>: Flash defines three types of<br />
symbols: Button, MovieClip, and Graphic. You can embed Button and<br />
MovieClip symbols in a Flex application, but you cannot embed a Graphic symbol because it cannot be exported for ActionScript.</em></p></blockquote>
<p>Here you can be sure that lack of exported for actionscript symbol is not accessible in Flex.</p>
<p>One of the main solutions is to embed the .swf as octet-stream:</p>
<p><code>[Embed(source="embed.swf", mimeType="application/octet-stream")]<br />
private var blue:Class;</code></p>
<p>followed by:</p>
<p><code>var loader:Loader = new Loader()<br />
loader.loadBytes(new blue());</code></p>
<p>And the key point of this will be the lines:</p>
<p><code>var red:Class = loader.contentLoaderInfo.applicationDomain.getDefinition("blue");<br />
var mc:MovieClip = new red() as MovieClip;</code></p>
<p>I hope this can help</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/03/01/flex-3-custom-datechooser-2/" rel="bookmark" title="Flex 3 Custom DateChooser">Flex 3 Custom DateChooser </a></li>
<li><a href="/2009/03/18/flex-3-text-editor/" rel="bookmark" title="Flex 3 text editor">Flex 3 text editor </a></li>
<li><a href="/2009/03/15/flex-3-bitmap-with-round-corners/" rel="bookmark" title="Flex 3 bitmap with round corners">Flex 3 bitmap with round corners </a></li>
<li><a href="/2009/02/06/flex-3-custom-preloader/" rel="bookmark" title="Flex 3 Custom Preloader">Flex 3 Custom Preloader </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/03/05/flex-3-import-swf-symbols/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
