Note that there are some explanatory texts on larger screens.

plurals
  1. POloadMovieNum in AS2/1 files loaded into an Air-based AS3 / Flex application
    text
    copied!<p>I am working with a very large number of legacy SWFs written in AS1 and AS2. These SWFs use <code>loadMovieNum</code> extensively.</p> <p>I am trying to integrate these into a new Air-based app (written in either AS3 or Flex). However, <code>loadMovieNum</code> doesn't seem to work within the Air app.</p> <p>For example, an AS2 SWF (<code>file1.swf</code>) may try to load another AS2 SWF using:</p> <pre><code>loadMovieNum("http://127.0.0.1/file2.swf", 5); </code></pre> <p>This works fine if the SWF is played indepedently but if it is played from within the Air app, it fails.</p> <p><strong>EDIT:</strong> What happens in the Air app is that <code>file1.swf</code> will load successfully but silently fails to load <code>file2.swf</code>. There are no errors and no exceptions. A <code>try...catch</code> around the <code>loadMovieNum</code> reports nothing and <code>file1.swf</code> continues to play.</p> <p>The relevent code from the Air app is as follows:</p> <p><strong>AS3 version:</strong></p> <pre><code>var mLoader:Loader = new Loader(); var mRequest:URLRequest = new URLRequest("http://127.0.0.1/file1.swf"); mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); mLoader.load(mRequest, loaderContext); function onCompleteHandler(loadEvent:Event):void { // Add to the stage addChild(mLoader.content.parent); } </code></pre> <p><strong>Flex version:</strong></p> <pre><code>&lt;mx:SWFLoader id="swfObj" source="http://127.0.0.1/file1.swf" /&gt; </code></pre> <p>It is simply the case that <code>loadMovieNum</code> will not work in Air? Or is there something that can be done. Obviously, making extensive changes to the legacy SWFs is, in all liklihood, not possible.</p> <p>Thanks in advance.</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