Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to load and run a Flex3 SWF inside Flex4 or vice versa?
    text
    copied!<p>I am interested in understanding how to run a Flex-3 SWF inside a Flex-4 SWF.</p> <p>My Flex-4 host app looks like this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"&gt; &lt;mx:SWFLoader source="SimpleFlex3App.swf" loadForCompatibility="true"/&gt; &lt;/s:Application&gt; </code></pre> <p>And this is the Flex-3 app:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="400"&gt; &lt;mx:Script&gt; &lt;![CDATA[ private function onClick():void { labelField.visible = true; } ]]&gt; &lt;/mx:Script&gt; &lt;mx:Button label="Click Me" click="onClick();" horizontalCenter="0" verticalCenter="-20"/&gt; &lt;mx:Label text="Clicked" visible="false" id="labelField" horizontalCenter="0" verticalCenter="20"/&gt; &lt;/mx:Application&gt; </code></pre> <p>I get a null object reference where the SWFLoader tries to set up the bridge. I assume it does not get an instance for the IMarshalSystemManager implementation.</p> <pre><code>IMarshalSystemManager(sm.getImplementation("mx.managers::IMarshalSystemManager")).addChildBridge(_swfBridge, this); </code></pre> <p>By using the SWFLoader and setting loadForCompatibility to true I was following the <a href="http://blogs.adobe.com/flexdoc/loadingSubApps.pdf" rel="nofollow noreferrer">adobe documentation</a>:</p> <p>I must be missing out on something very simple as both, my host and hosted apps, basically don't do anything special. </p> <p>Further, is it possible to do the opposite and run a Flex-4 based SWF inside a Flex-3 one? In my opinion the adobe doc does not clearly say yes or no.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload