<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Cast a loaded Flex Application to an Interface</title>
	<atom:link href="http://www.flexdaddy.com/2010/01/19/cast-a-loaded-flex-application-to-an-interface/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexdaddy.com/2010/01/19/cast-a-loaded-flex-application-to-an-interface/</link>
	<description>Andrew Spaulding on Adobe Flash Platform Technologies</description>
	<lastBuildDate>Tue, 19 Jan 2010 12:00:54 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gertjan</title>
		<link>http://www.flexdaddy.com/2010/01/19/cast-a-loaded-flex-application-to-an-interface/comment-page-1/#comment-254262</link>
		<dc:creator>Gertjan</dc:creator>
		<pubDate>Tue, 19 Jan 2010 12:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexdaddy.com/?p=336#comment-254262</guid>
		<description>Hi Andrew,

The instantiation of my SWFLoader:

if ( !_swfLoader ) {
	_swfLoader = new SWFLoader();
	_swfLoader.loaderContext = new LoaderContext( true, null, SecurityDomain.currentDomain );
	_swfLoader.scrollRect = new Rectangle( 0, 0, 740, 370 );
	_swfLoader.autoLoad = true;
	_swfLoader.addEventListener( Event.COMPLETE, playFlash );
}

_swfLoader.source = _source;

I allready did this in de beginning, only then I also set trustContent to true and used &#039;null&#039; for security domain. This is basicly the same as your code, except the ApplicationDomain part, but that didn&#039;t gave me an issue.</description>
		<content:encoded><![CDATA[<p>Hi Andrew,</p>
<p>The instantiation of my SWFLoader:</p>
<p>if ( !_swfLoader ) {<br />
	_swfLoader = new SWFLoader();<br />
	_swfLoader.loaderContext = new LoaderContext( true, null, SecurityDomain.currentDomain );<br />
	_swfLoader.scrollRect = new Rectangle( 0, 0, 740, 370 );<br />
	_swfLoader.autoLoad = true;<br />
	_swfLoader.addEventListener( Event.COMPLETE, playFlash );<br />
}</p>
<p>_swfLoader.source = _source;</p>
<p>I allready did this in de beginning, only then I also set trustContent to true and used &#8216;null&#8217; for security domain. This is basicly the same as your code, except the ApplicationDomain part, but that didn&#8217;t gave me an issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tink</title>
		<link>http://www.flexdaddy.com/2010/01/19/cast-a-loaded-flex-application-to-an-interface/comment-page-1/#comment-254260</link>
		<dc:creator>Tink</dc:creator>
		<pubDate>Tue, 19 Jan 2010 11:53:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexdaddy.com/?p=336#comment-254260</guid>
		<description>Would they be best off using a Module, instead of a full blow Flex app, inside another?</description>
		<content:encoded><![CDATA[<p>Would they be best off using a Module, instead of a full blow Flex app, inside another?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett Coffin</title>
		<link>http://www.flexdaddy.com/2010/01/19/cast-a-loaded-flex-application-to-an-interface/comment-page-1/#comment-254248</link>
		<dc:creator>Brett Coffin</dc:creator>
		<pubDate>Tue, 19 Jan 2010 10:11:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexdaddy.com/?p=336#comment-254248</guid>
		<description>Flex 4 b2 (10485) simple loading sub-app with Externalizing application classes. Does anyone has a working example ?
I am trying this with the most simple application and I am getting rte &quot;Could not find compiled resource bundle &#039;components&#039; for locale &#039;en_US&#039;.&quot; ???</description>
		<content:encoded><![CDATA[<p>Flex 4 b2 (10485) simple loading sub-app with Externalizing application classes. Does anyone has a working example ?<br />
I am trying this with the most simple application and I am getting rte &#8220;Could not find compiled resource bundle &#8216;components&#8217; for locale &#8216;en_US&#8217;.&#8221; ???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Spaulding</title>
		<link>http://www.flexdaddy.com/2010/01/19/cast-a-loaded-flex-application-to-an-interface/comment-page-1/#comment-254242</link>
		<dc:creator>Andrew Spaulding</dc:creator>
		<pubDate>Tue, 19 Jan 2010 09:22:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexdaddy.com/?p=336#comment-254242</guid>
		<description>Hi Gertjan,

Oh, loading from a different domain will hit security sandbox issues! You should be able to get around it like you have above... but here&#039;s some code in a little more detail.

The code assumes you set your mx:SWFLoader id=&quot;swfLoader&quot; 

import flash.system.SecurityDomain;
import flash.system.ApplicationDomain;

var context:LoaderContext = new LoaderContext();
context.securityDomain = SecurityDomain.currentDomain;
context.applicationDomain = new ApplicationDomain();
swfLoader.loaderContext = context;                 
swfLoader.source = &quot;http://otherdomain.com/RemoteApp.swf&quot;;

Interested to know if the above works for you. Set this up before you set the source for the SWFLoader.

-- Andrew</description>
		<content:encoded><![CDATA[<p>Hi Gertjan,</p>
<p>Oh, loading from a different domain will hit security sandbox issues! You should be able to get around it like you have above&#8230; but here&#8217;s some code in a little more detail.</p>
<p>The code assumes you set your mx:SWFLoader id=&#8221;swfLoader&#8221; </p>
<p>import flash.system.SecurityDomain;<br />
import flash.system.ApplicationDomain;</p>
<p>var context:LoaderContext = new LoaderContext();<br />
context.securityDomain = SecurityDomain.currentDomain;<br />
context.applicationDomain = new ApplicationDomain();<br />
swfLoader.loaderContext = context;<br />
swfLoader.source = &#8220;http://otherdomain.com/RemoteApp.swf&#8221;;</p>
<p>Interested to know if the above works for you. Set this up before you set the source for the SWFLoader.</p>
<p>&#8211; Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gertjan</title>
		<link>http://www.flexdaddy.com/2010/01/19/cast-a-loaded-flex-application-to-an-interface/comment-page-1/#comment-254241</link>
		<dc:creator>Gertjan</dc:creator>
		<pubDate>Tue, 19 Jan 2010 09:02:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexdaddy.com/?p=336#comment-254241</guid>
		<description>Hi Andrew!

Thanks for your post and your effort. I really appreciate it!

But, what you are describing here is exact what I came up with. But it threw a SecurityError.

The .swf that I&#039;m loading is located on a different domain than the parent. So I tried some security settings (I really should dive in more, I know) and ended up with:

_swfLoader.trustContent = true;
_swfLoader.loaderContext = new LoaderContext( true, null, null );
(and as it turns out trustContent is ignored when loaderContext is manually set)

This worked fine when I tested my main .swf on my machine (still grabbing the loaded .swf from the www).
But online it threw a SecurityError when I tried to cast _swfLoader.content to my interface (even when I tried casting it to a SystemManager).

Now my _swfLoader just uses:
_swfLoader.loaderContext = new LoaderContext( true, null, SecurityDomain.currentDomain );

Now it throws a SecurityError offline, but online everything works as expected. (which I like!).

I hope it makes some sense... if not, (and if you&#039;re interested) I&#039;ll explain in more detail.

Again, thanks for your help!</description>
		<content:encoded><![CDATA[<p>Hi Andrew!</p>
<p>Thanks for your post and your effort. I really appreciate it!</p>
<p>But, what you are describing here is exact what I came up with. But it threw a SecurityError.</p>
<p>The .swf that I&#8217;m loading is located on a different domain than the parent. So I tried some security settings (I really should dive in more, I know) and ended up with:</p>
<p>_swfLoader.trustContent = true;<br />
_swfLoader.loaderContext = new LoaderContext( true, null, null );<br />
(and as it turns out trustContent is ignored when loaderContext is manually set)</p>
<p>This worked fine when I tested my main .swf on my machine (still grabbing the loaded .swf from the www).<br />
But online it threw a SecurityError when I tried to cast _swfLoader.content to my interface (even when I tried casting it to a SystemManager).</p>
<p>Now my _swfLoader just uses:<br />
_swfLoader.loaderContext = new LoaderContext( true, null, SecurityDomain.currentDomain );</p>
<p>Now it throws a SecurityError offline, but online everything works as expected. (which I like!).</p>
<p>I hope it makes some sense&#8230; if not, (and if you&#8217;re interested) I&#8217;ll explain in more detail.</p>
<p>Again, thanks for your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: @gertjansmits asked a bunch of Q&#8217;s about loading a SWF with SWFLoader and casting it to an Interface &#124; The Question Room</title>
		<link>http://www.flexdaddy.com/2010/01/19/cast-a-loaded-flex-application-to-an-interface/comment-page-1/#comment-254214</link>
		<dc:creator>@gertjansmits asked a bunch of Q&#8217;s about loading a SWF with SWFLoader and casting it to an Interface &#124; The Question Room</dc:creator>
		<pubDate>Tue, 19 Jan 2010 05:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexdaddy.com/?p=336#comment-254214</guid>
		<description>[...] Over at Flex Daddy Andrew Spaulding (@spaulds) has written a post titled &#8220;Cast a loaded Flex Application to an Interface&#8221;. [...]</description>
		<content:encoded><![CDATA[<p>[...] Over at Flex Daddy Andrew Spaulding (@spaulds) has written a post titled &#8220;Cast a loaded Flex Application to an Interface&#8221;. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<br />
<b>Fatal error</b>:  Cannot redeclare class services_json in <b>/nfs/c02/h05/mnt/15793/domains/flexdaddy.info/html/wp-includes/class-json.php</b> on line <b>115</b><br />
