AIR 3.6 & 3.7 Loading Remote SWF Crashes iOS on Property Read

I have been trying out the feature in AIR SDK 3.6 that allows you to load local swf files with ABC.  This is working fine.  However, I am getting a crash on an iOS AOT build when I load a remote swf that does NOT have ABC and I try to read any property on that remote asset.  I have never had this problem with AIR 3.4.  The problem persists on AIR 3.7
Below is a simple example to reproduce the problem.  The crash will occur immediately when it attempts to trace the "currentLabels" property of the loaded content.  I believe the property itself to be arbitrary --- the same crash will occur when reading any property.  In fact, you can even set a breakpoint before that line and in the Flash Builder debugger, if you try to expand the content's properties the app will crash.
package
          import flash.display.Loader;
          import flash.display.MovieClip;
          import flash.display.Sprite;
          import flash.display.StageAlign;
          import flash.display.StageScaleMode;
          import flash.events.Event;
          import flash.events.ProgressEvent;
          import flash.net.URLRequest;
          import flash.system.ApplicationDomain;
          import flash.system.LoaderContext;
          public class MobileAppTest extends Sprite
  private const path:String = "https://s3.amazonaws.com/wowzers-dev/mobile/client/";
                    private var files:Array = ["art/common/LoadingScreen.swf"];
                    public function MobileAppTest()
                              super();
                              stage.align = StageAlign.TOP_LEFT;
                              stage.scaleMode = StageScaleMode.NO_SCALE;
                              loadNext();
                    private function loadNext():void {
                              var loader:Loader = new Loader();
                              var req:URLRequest = new URLRequest(path + files[0]);
  trace("\n>>> loading: " + req.url);
                              loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
                              loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
                              var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                              loader.load(req, context);
                    private function onLoadProgress(evt:ProgressEvent):void {
                              trace(evt.bytesLoaded + " out of " + evt.bytesTotal);
                    private function onLoadComplete(evt:Event):void {
                              trace("<<< onLoadComplete " + evt.currentTarget.contentType);
                              trace("=== currentLabels: " + evt.currentTarget.content.currentLabels);
Am I doing something wrong?  Is this a known issue that will be fixed?
So far I have tested this on an iPad 3 with iOS 6.1.3.
Thank you.

I was having the same problem using CS5.5 and AIR 3.7.  For me, the solution was to put a label in my main timeline and then call this.currentLabels in the main .as class.
My app was crashing every time I called the "currentLabels" property from a custom class controlling a remote SWF.  I thought that it might have been a problem with the FrameLabel class not being imported at compile-time, so I tried placing a flash.display.FrameLabel reference in the main class.  This did not fix the problem.  Then I tried making an arbitrary call to the currentLabels property of my main timeline (all you need to do is reference it) and everything else worked fine.
*edit*
After a little further testing, it seems that you can place the reference anywhere (I put it in my custom class by calling theRemoteSWF.parent.currentLabels), but that you must have a label somewhere in the main timeline and call the "currentLabels" property of your main SWF before referencing the currentLabels of a child SWF

Similar Messages

  • Loading a remote SWF via SWFLoader Issue

    I have a simple flex app which loads an external XML into an
    arrayCollection using HTTPService send method. This works fine as
    both a stand-alone, or when loaded into it's parent as a LOCAL file
    via the SWFLoader tag. However, when I place this child file onto a
    remote server and try to load it into the parent which resides on
    my desktop, the ArrayCollection default resultFormat of the send
    method triggers the following runtime error (listed below). I don't
    think it's a sandbox issue because when I change result format to
    e4x, it works fine remotely. I've been hitting a wall on this for
    days now... Any insight would be greatly appreciated and thanks to
    all in advance!!!
    PARENT SWF (resides on local desktop)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical" initialize="initData()">
    <mx:Script>
    <![CDATA[
    public var baseURL:String;
    public function initSWF(swfURL:String):void {
    remote_swf.load(swfURL);
    public function initData():void
    baseURL = "
    http://blahblahblah";
    Security.allowDomain(baseURL);
    ]]>
    </mx:Script>
    <!-- WORKS when loading child swf LOCALLY -->
    <mx:Button label="Load LOCAL SWF APP"
    click="initSWF('remoteSWF.swf')"/>
    <!-- DOES NOT WORK when loading child swf REMOTELY -->
    <mx:Button label="Load REMOTE SWF APP" click="initSWF('
    http://blahblahblah/remoteSWF.swf')"/>
    <!-- LOADER -->
    <mx:SWFLoader height="100%" width="100%" id="remote_swf"
    autoLoad="false" visible="true" scaleContent="false"/>
    </mx:Application>
    CHILD SWF (resides on remote server)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="getXMLData()">
    <mx:HTTPService id="myTeams" url="
    http://blahblahblah/xml/myXML.xml"/>
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    public function getXMLData():void
    Alert.show(Security.sandboxType);
    myTeams.send();
    ]]>
    </mx:Script>
    <mx:Label text="THIS IS THE LOADED SWF WHICH HAS JUST
    PERFORMED A SEND ON HTTP SERVICE TO CREATE ARRAY
    COLLECTION"></mx:Label>
    </mx:Application>
    ------------ RUNTIME ERROR ---------------------------------
    ArgumentError: Error #1063: Argument count mismatch on
    Object/
    http://adobe.com/AS3/2006/builtin::hasOwnProperty().
    Expected 0, got 2.
    at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
    at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
    at mx.rpc.xml::SimpleXMLDecoder/decodeXML()
    at mx.rpc.http::HTTPService/
    http://www.adobe.com/2006/flex/mx/internal:rocessResult()
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::resultHandler()
    at mx.rpc::Responder/result()
    at mx.rpc::AsyncRequest/acknowledge()
    at :irectHTTPMessageResponder/completeHandler()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio
    n()
    at flash.events::EventDispatcher/dispatchEvent()
    at
    flash.net::URLLoader/flash.net:URLLoader:nComplete()

    After further investigations, it appears that the problem might be, due the fact that in the remote (loaded) swf, the following is null:
    var sm:ISystemManager = ISystemManager(SystemManagerGlobals.topLevelSystemManagers[0]);
    sm.swfBridgeGroup <----- equals null
    I tried creating the swfBridgeGroup in the local (loading) swf, but the loaded one still thinks it is null.
    Any ideas?

  • AIR App Crashes iOS After Loading Remote Image

    I have had this problem both with the latest official AIR SDK 3.3 (3.3.0.3670) and 3.4 release (3.4.0.2540) when doing a Standard build.  I am loading a few files one after the other from a remote server on an iPad.  After loading some xmls and swfs successfully, my app crashes and closes without any error message upon loading an image file (I've tried both png and jpg with the same result).  I have both progress and complete event listeners on the loader and the crash happens after all bytes are loaded and before the complete event triggers.  So it seems as if there is some problem with initializing/decompressing the image.  The crash log reports things along the lines of "EXC_BAD_ACCESS" and "KERN_INVALID_ADDRESS."
    This problem does not occur if the files are loaded from the application directory --- only when they are loaded from the remote server.  It is also not occuring with the preview AIR SDK 3.4 with iOS6 Support release (3.4.0.3010).  It is also not occuring on the desktop simulator (adl) or the Fast mode debug option.
    Right now all I can gather is that it is a bug with the AIR SDK that seems to be resolved in upcoming versions, however I am due to submit my app to the app store September 4th so I don't really have the time to wait!
    Please advise on how I can go about tackling this issue.
    The issue occurs with any combination of the following:
    Flash Builder 4.6
    Flex SDK 4.5.1 or 4.6
    AIR SDK 3.3 or 3.4
    iPad 1/2/3 with iOS 5.1.1

    Hi,
    Could you please consider it raising via bugbase.adobe.com and share the bug number here for reference. Also, we would request you to attach sample source files which can replicate the issue.
    -Thanks for reporting it.
    Pahup

  • Is it possible to load REMOTE resource module  from an Air application ?

    Hi All,
              Am trying to load remote resource module swf file from an AIR application, am not able make it work,am getting the following error
    code:
    eventDispatcher = ResourceManager.getInstance().loadResourceModule(remoteURL);
    ERROR:
    "Unable to load resource module from ".
    Please help me out..
    Thanks
    J Kishore

    This might help you out: http://aaronhardy.com/flex/loading-a-remote-module-into-a-local-app/

  • Fiexed! AIR 3.7 on ios load packaged swf problem

    I have fixed this, thanks. It's because this:
    <mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
    output="${OUTPUT_DIR}/${APP_NAME}.swf"
    static-rsls="true" It's the problem
    accessible="true"
    configname="air"
    debug="${DEBUG_FLAG}"
    failonerror="true"
    fork="true"
    maxmemory="512m">
    Hi, nice guys
    Thanks for your time to watch my proble!
    I'm develop IOS App by AIR 3.7. I have seen this about load swf http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air- apps-on-ios/  . Everything works fine in debug mode, but when I release it , everything is gone.
    I'm using AIR 3.7 in GPU renderer mode, and load SWF with some code. I have add LoaderContext.
    var l:LoaderContext=new LoaderContext(false, ApplicationDomain.currentDomain);
    l.allowCodeImport=true;
    When I debug in Fast mode, everything is ok, in Standard mode package get the Errors:
    Error occurred while packaging the application:
    java.lang.NegativeArraySizeException
              at com.adobe.air.ipa.SWFUtils.read(SWFUtils.java:205)
              at com.adobe.air.ipa.SWFUtils.inspect(SWFUtils.java:250)
              at com.adobe.air.ipa.SWFUtils.<init>(SWFUtils.java:181)
              at com.adobe.air.ipa.SWFSplitter.main(SWFSplitter.java:68)
    Exception in thread "main" com.adobe.air.InvalidInputException: Invalid input. Not a valid swf file
              at com.adobe.air.ipa.SWFSplitter.main(SWFSplitter.java:105)
    Compilation failed while executing : ADT
    When I use a empty project to load a test swf, get the Error:
    Main Thread (Suspended: Error: Error #3747: Multiple application domains are not supported on this operating system.)
    Anybody know how to fix this ?
    Thanks!

    i have same problem. but i did not understand where is this code? where should i look?
    """<mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
    output="${OUTPUT_DIR}/${APP_NAME}.swf"
    static-rsls="true" It's the problem
    accessible="true"
    configname="air"
    debug="${DEBUG_FLAG}"
    failonerror="true"
    fork="true"
    maxmemory="512m">""""

  • AIR 3.7 Problem Loading Multiple Similar SWFs On iOS

    I'm running into an issue with loading multiple SWFs using AIR 3.7 on iOS. The exact same code works fine on Android.
    The issue is that if I include 2 specific SWFs then neither of them will load correctly. When I include just one of the SWFs it works great. I've also tried including a second SWF which is pretty much empty and that also works. Additionally, I've been able to load a MovieClip out of the first SWF IF addChild() was first used on myswf1 and that works even when the main SWF did not. Lastly if I include 2 of the exact same SWFs (with different filenames) that also works.
    So my question is what is it about the two SWFs that causes it not to work? They are effectively the same except each has custom assets and custom class naming.
    Both of them subclass off one main class like this:
    class myswf1 extends mymain
    class mymain extends MovieClip
    class myswf2 extends mymain
    class mymain extends MovieClip
    So both SWFs contain mymain seperately from each other. Could that be the issue? Like when it compiles all the code into the package SWF the
    two mymain root classes clash?
    In the past it seems like that should still work it just uses the first loaded class and that is it.
    The errors that I get seem to happen on lines like this:
    selectableHudOptions.bonustime.mouseEnabled = false;
    Where selectableHudOptions.bonustime is basically null. However, when I just have 1 SWF this line works fine.  If I loop through selectableHudOptions's children it is blank when I am loading the two SWFs but it shows all of the children when just loading the one SWF.
    Another theory I have about it is that it seems like addChild() has to be used on the objects and frames have to go by before the children are visible. Like addChild() is being delayed somehow because of the multiple SWFs. Or addChild() is behaving asyncronously and my code is running syncronously.
    I think Nimisha from Adobe has worked on these multiple SWF issues before.

    Yes, duplicate symbol conflict looks like the cause of your issue.
    This is a known issue in AOT mode. For now, could you please try renaming mymain to something else when using it in the second swf?
    Or you may place mymain into separate swc, and link one of your swfs with "merged into code" option, while the other one "externally", so that only one of the swfs has mymain defined and there is no clash.
    Please do let us know if either of the solutions work for you.

  • [advance question] loading a swf in adobe Air, which loads an image with "componentloader"

    Good evening all,
    I think this is a complex issue.
    I have adobe air application which loads a SWF I made.
    Inside this SWF I have used the "component LOADER" to load
    something with "ContentPath=image.jpg" for example.
    But the swf loaded in the Adobe air works, but does not load
    the "ContentPath image"...
    (it does load and display it when it this swf is run outside
    adobe Air)
    I need it to be dynamic like this, so if eventually I Include
    it in the package it won't help much...
    I just intend to replace an image background from this loaded
    swf file!
    Thanks!
    Edit:
    At this time of the editing, I fear and realize
    something....I have been using Actionscript2 for the .SWF file,
    could it be why it does not works???
    If its problematic, is there a simple way like telling it to
    read actionscript2, rather than transforming everything??
    edit2:
    I found this on the official AIR FAQ:
    Will Flash version 8 and below SWF files run in Adobe AIR?
    Yes. However, the Adobe AIR APIs are only exposed to Flash
    content via ActionScript 3 / AVM2, and thus Flash 8 / AVM1 SWFs
    will be able to run, but they will not have direct access to the
    Adobe AIR APIs.
    source:
    source
    faq Adobe
    it seems it should works!!??
    Edit3:
    nope I confirm at least some code made in Actionscript2
    works.
    I am sure this code needed to be changed for working in
    actionscript3, so "actionscript2" code works in Adobe Air.
    The problem of not loading my image must come from something
    else!!??

    Good Morning all!
    Hilarious....
    I tried so much to think maybe Adobe Air does not like a SWF
    using actionscript2, or it does not load any "external image from a
    swf", etc...
    None of that!
    I just in FLASH in the ComponentLoader....I did put simply
    the ContentPath at "myimage.jpg"....
    Of course I had to use the absolute path like
    "c:\\myfolder\\myimage.jpg"
    Of course aswell it works now!!!

  • Flash AIR app cannot load child swfs on publish to device

    I have been struggling with this problem for WEEKS now and can't solve it. I have an flash AIR app (creative cloud, AIR 3.8) which is very simple: all it does is load external SWF movies on the click of a start button. It works FINE in test/PC but when I publish to device, the external swfs do not load.
    Here is the code on the main timeline that calls the external swfs:
    //start button
    start_button_TRI_desmatosuchus.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_02_3,false,0,true);
    import fl.display.ProLoader;
    import flash.events.Event;
    var fl_ProLoader_02:ProLoader;
    var fl_ToLoad_02:Boolean = true;
    function fl_ClickToLoadUnloadSWF_02_3(event:MouseEvent):void
              if(fl_ToLoad_02)
                        fl_ProLoader_02 = new ProLoader();
                        fl_ProLoader_02.load(new URLRequest("dinofilms/triassic_desmatosuchus.swf"));
                        fl_ProLoader_02.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete_02 )
                        addChild(fl_ProLoader_02);
                        fl_ProLoader_02.x = 0;
                        fl_ProLoader_02.y = 144;
              else
                        if (fl_ProLoader_02!=null) {
                                  removeChild(fl_ProLoader_02);
                                  fl_ProLoader_02.unloadAndStop();
                                  fl_ProLoader_02 = null;
              fl_ToLoad_02 = !fl_ToLoad_02;
    function onComplete_02(e:Event):void {
              e.currentTarget.content.addEventListener(Event.ENTER_FRAME,OEF_02);
    function OEF_02(e:Event):void {
              if (e.currentTarget.currentFrame==e.currentTarget.totalFrames) {
                        e.currentTarget.stop();
                        e.currentTarget.removeEventListener(Event.ENTER_FRAME,OEF_02);
                        removeChild(fl_ProLoader_02);
                        fl_ProLoader_02.unloadAndStop();
                        fl_ProLoader_02 = null;
    I am calling about 30 different movies on 30 different frames, so that's why I am using tags like "proLoader_01" so I don't duplicate them. All the external swfs are of course listed in the included files too.
    I would really appreciate the assistance, I am a reluctant coder!
    Message was edited by: Fiona Passantino

    OK, I replaced all the "ProLoader" instances with "Loader" and I am getting an error, below (see***)
        //start button
        start_button_TRI_coelophysis.addEventListener(MouseEvent.CLICK,
        fl_ClickToLoadUnloadSWF_01_3,false,0,true);
        import fl.display.Loader; **HERE, ERROR IS: 1172 fl.display:Loader could not be found**
        import flash.events.Event;
        var fl_Loader_01:Loader;
        //This variable keeps track of whether you want to load or unload the SWF
        var fl_ToLoad_01:Boolean = true;
        function fl_ClickToLoadUnloadSWF_01_3(event:MouseEvent):void
         if(fl_ToLoad_01)
              fl_Loader_01 = new Loader();
              fl_Loader_01.load(new URLRequest("dinofilms/triassic_coelophysis.swf"));
              fl_Loader_01.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete_01)
              addChild(fl_Loader_01);
              fl_Loader_01.x = 0;
              fl_Loader_01.y = 144;
         else
              if(fl_Loader_01!=null) {
                   removeChild(fl_Loader_01);
                   fl_Loader_01.unloadAndStop();
                   fl_Loader_01 = null;
         fl_ToLoad_01 = !fl_ToLoad_01;
        function onComplete_01(e:Event):void {
         e.currentTarget.content.addEventListener(Event.ENTER_FRAME,OEF_01);
        function OEF_01(e:Event):void {
         if(e.currentTarget.currentFrame==e.currentTarget.totalFrames) {
              e.currentTarget.stop();
              e.currentTarget.removeEventListener(Event.ENTER_FRAME,OEF_01);
              removeChild(fl_Loader_01);
              fl_Loader_01.unloadAndStop();
              fl_Loader_01 = null;

  • Loading external swf in AIR

    In AS3 this would load loadme.swf into my holding mc
    (contentmc) provided both the holding swf and loadme.swf are in the
    same directory
    var loaderMC:Loader=new Loader();
    loaderMC.load(new URLRequest("loadme.swf"));
    contentmc.addChild(loaderMC);
    But it does not work in AIR. Any reason why? what am i
    missing out or is there a new way to do it?
    thanks
    Murtaza Topiwalla

    What if you don't want the external swf to be packaged in the
    air file? I want the air file to pull the swf from the http, as it
    does with jpegs:
    Yay, this displays the jpeg
    loaderMC.load(new URLRequest("
    http://mywebsite.com/loadme.jpg"));
    Same code but it doesn't display the swf:
    loaderMC.load(new URLRequest("
    http://mywebsite.com/loadme.swf"));

  • Problems loading Flex3 swf into AIR app

    This is a challenging problem that I have reduced down to the
    bare minimum and it is still reproduceable. I have built a minimal
    AIR application and added a SWFLoader to it which loads a SWF file
    named "Junk.swf" using an absolute path.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" title="Hello World">
    <mx:Style>
    WindowedApplication {
    background-color:"0x999999";
    background-alpha:"0.5";
    </mx:Style>
    <mx:SWFLoader
    source="C:/myProjectFolder/renderers/Junk.swf" width="100%"
    height="100%" />
    </mx:WindowedApplication>
    This works fine if I run the application from within Flex3,
    however when I build an installer, install the application to my
    windows vista system and execute it from the desktop the Junk.swf
    will not display. If I replace the Junk.swf with another SWF of the
    same name created in Flash CS3 then it will display properly when
    my test app is executed from either Flex or the desktop.
    The contents of the loaded SWF don't appear to be an issue
    since even the simplest of Flex3 SWFs fail to display.
    Interestingly when I add listeners to the SWFLoader to
    determine if any errors are happening no error events are sent, but
    I do receive both the INIT and COMPLETE events which tells me that
    the Junk.swf is found and loaded, just not displayed.
    Any assistance or even ideas that I could try would be
    appreciated.

    that's why i added those comments about the swf's domain.  for locally loaded swfs, use:
    SFMltd wrote:
    Hi Kglad, Thanks for the Example.
    if i run my class with securityDomain = SecurityDomain.currentDomain; then it throws this error: SecurityError: Error #2142: Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property.
    The swf file im trying to load is stored locally so i guess this error makes sense. However if i comment out that line i get the same "cannot access Stage owned by app" error?
    See below for class:
    package  {
      import flash.display.MovieClip;
      import flash.filesystem.File;
      import flash.events.Event;
      import flash.net.FileReference;
      import flash.events.MouseEvent;
      import flash.display.Loader;
      import flash.net.URLRequest;
      import flash.system.LoaderContext;
      import flash.system.ApplicationDomain;
      import flash.system.SecurityDomain;
      public class assetPreview extends MovieClip {
      private var loader:Loader;
      private var mainSWF:MovieClip = new MovieClip();
      public function assetPreview() {
      addEventListener(Event.ADDED_TO_STAGE, initialise);
      public function initialise(e:Event):void
      removeEventListener(Event.ADDED_TO_STAGE, initialise);
      var allowSWF:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
    // allowSWF.securityDomain = SecurityDomain.currentDomain;
      loader = new Loader();
      loader.load( new URLRequest(settingsXML.pathToSWF),allowSWF);
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE, viewPreview);
      public function viewPreview(e:Event):void
      addChild(mainSWF);
      mainSWF.addChild(loader);

  • Loading multiple swfs using air 3.6 for ios

    Adobe, can you please provide us with the code to load multiple swf files for ios. Please provide examples. The code below loads multiple swfs, but the swfs stall, so this does not seem to be a solution.
    Code description: A flash file made up of 4 frames with forward and back buttons that navigate from frame to frame. The code loads three different swf files in frames 2, 3 and 4.
    Frame 1:
    var myLoader:Loader;
    var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader == null){myLoader = new Loader(); addChild(myLoader); }
    else {myLoader.unload();}
    Frame 2:
    myLoader.unload();
    myLoader.load(new URLRequest("file1.swf"),loaderContext);
    Frame 3:
    myLoader.unload();
    myLoader.load(new URLRequest("file2.swf"),loaderContext);
    Frame 4:
    myLoader.unload();
    myLoader.load(new URLRequest("file3.swf"),loaderContext);

    I've just tried loading, unloading and then loading again same SWF with 2 library objects linked for AS3 export. It worked both on simulator and on device in debug mode. When I look inside swf it does contain AS3 code.
    So is my swf a pure asset SWF? Or Intellij Idea 12 that I'm using does stripping automatically?
    And then I've read your comment at http://forums.adobe.com/message/5217325#5217325 and run 'swfdump' utility on my .swf file. Looks like there's no ABC2 code, that's why app was able to load, unload and load again the same swf.
    public dynamic class net.games.bg extends flash.display.MovieClip
      native public function bg():*;
      native public var one:flash.display.MovieClip;
      native public var three:flash.display.MovieClip;
      native public var two:flash.display.MovieClip;
    public dynamic class net.games.z1 extends flash.display.MovieClip
      native public function z1():*;
    I can access objects as instances through root  or as objects through getDefinition.
    private var aLoader : Loader;
    private function init():void
                load1();
            private function load1():void
                aLoader   = new Loader();
                var url:URLRequest = new URLRequest("levels/expirementlevel1.swf");
                var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                aLoader.load(url, loaderContext); // load the SWF file
                aLoader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, handleSWFLoadComplete1, false, 0, true);
            private function handleSWFLoadComplete1(e:flash.events.Event):void {
                var levelObjectsMC:flash.display.MovieClip = e.target.loader.content;
                for (var i:uint = 0; i < levelObjectsMC.numChildren; i++){
                    trace ('\t|\t ' +i+'.\t name:' + levelObjectsMC.getChildAt(i).name + '\t type:' + typeof (levelObjectsMC.getChildAt(i))+ '\t' + levelObjectsMC.getChildAt(i).x);
                var LibraryClass:Class = e.target.applicationDomain.getDefinition("net.games.z1") as Class;
                var myLibraryObject:flash.display.MovieClip = new LibraryClass as flash.display.MovieClip;
                trace(' load 1 ' + myLibraryObject);
                aLoader.unload();
                load2();
                //addChild(levelObjectsMC);
            private function load2():void
                aLoader   = new Loader();
                var url:URLRequest = new URLRequest("levels/expirementlevel1.swf");
                var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                aLoader.load(url, loaderContext); // load the SWF file
                aLoader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, handleSWFLoadComplete2, false, 0, true);
            private function handleSWFLoadComplete2(e:flash.events.Event):void {
                var levelObjectsMC:flash.display.MovieClip = e.target.loader.content;
                for (var i:uint = 0; i < levelObjectsMC.numChildren; i++){
                    trace ('\t|\t ' +i+'.\t name:' + levelObjectsMC.getChildAt(i).name + '\t type:' + typeof (levelObjectsMC.getChildAt(i))+ '\t' + levelObjectsMC.getChildAt(i).x);
                var LibraryClass:Class = e.target.applicationDomain.getDefinition("net.games.z1") as Class;
                var myLibraryObject:flash.display.MovieClip = new LibraryClass as flash.display.MovieClip;
                trace('load 2 x ' + myLibraryObject.x);
                aLoader.unload();

  • Loading local swf files from Application Dir (ios)

    Hi Guys,
    I would like to load additional local swf files to my ios release build but I am confused a little bit because of the new API changes.
    As far as I know at the moment (from Air 3.7 or newer) it is allowed to load local swf files that contains compiled actionscript both from local folder and from a predefined remote host as well. 
    My assumption based on this article:
    http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air- apps-on-ios/
    I created the text file to include all of my local swf file names and created the following node in the application.xml:
    <iPhone>
           <externalSwfs>assets/SampleSWFInfoFile.txt</externalSwfs>
    </iPhone>
    When I compile the release build (ipa) using command line adt, it converts all of my local swfs into the stripped swfs which is perfect, but even though I include all the swfs in the compiler command, it puts only the SampleSWFInfoFile.txt file into the assets folder in the ipa but not the swf files.
    I assume, it thinks I will load these files from an external host, but I would like to include them in the app itself.
    I tried to copy the stripped swf files from the externalStrippedSwfs folder and comment the <externalSwfs>assets/SampleSWFInfoFile.txt</externalSwfs> node in the application.xml and compile it and this way it puts the swf files into the ipa, but when I try to install and launch the app it crashes and when I test it using Flash Builder it shows an error message
    "VerifyError: Error #1042: Not an ABC file."
    Do any of you guys know the  solution for this problem?
    Thank you for your help in advance!

    You're publishing in AOT mode as long as you use one of these:
    The AIR Developer Tool or ADT has targets that lets you package apps either for the AOT mode or Interpreter mode. The targets for packaging in AOT mode are ipa-app-store, ipa-ad-hoc, ipa-test and ipa-debug.
    Flash Pro CS6 and Flash Builder automate this process pretty well so it's invisible but the SWF loads and executes code just fine for me when directly published.
    If I take it to command line I can use this to compile successfully (iPad test app):
    adt -package -target ipa-ad-hoc -storetype pkcs12 -keystore my.p12 -provisioning-profile my.mobileprovision NameOfApp.ipa NameOfApp-app.xml NameOfApp.swf iTunesArtwork iTunesArtwork@2x AppIconsForPublish swfs/swfs.txt swfs/GenerateText.swf
    I at least include generic icons in there but I made a 'swfs' folder and placed 'swfs.txt' and 'GenerateText.swf' in there. The SWF uses code to randomly generate text and changes every second using a Timer. I load it in using the same code you do with the ApplicationDomain.currentDomain context. I see the SWF appear and text start randomly changing.
    As I compile there's a folder generated called 'externalStrippedSwfs' with the stripped SWF in there.
    One thing to note is I do not supply <externalSwfs>swfs/swfs.txt</externalSwfs> in my iPhone settings. If I do that it doesn't work. I supply the path to the text file containing the SWF I want to be stripped to adt itself along with the SWFs I want stripped and it takes care of the rest.

  • Unable to load external swf which has runtime sharing with another swf.

    Hi,
    I am getting issues on loading external swf say "importer.swf" file into another swf file say "loader.swf" for second time like
    ReferenceError: Error #1065: Variable testSymbol is not defined. VerifyError: Error #1014: Class testClass could not be found.
    at global$init()
    In the external swf "importer.swf", i am trying to import the symbol "testSymbol" from another swf file say "exporter.swf", which exports through runtime sharing option for the symbols.
    I am having some buttons in loader.swf file and on each button click i am loading different swf files into the loader.swf after unloading the previous one.
    I am able to load and unload different swf files but unable to load the importer.swf file which is sharing symbols from external swf and that too for the second time i.e., when i click the button twice.
    When trying to debug with flash debugger, all the other swf files are being unloaded before loading of another swf but the swf which is sharing symbols/classes with another swf is not getting unloaded.
    Output when i am trying to load two files example and importer files into loader.swf file on two different button clicks. On first button click example.swf is loaded. On second button click , example.swf is unloaded and importer.swf is loaded which is successful. On first button click again importer.swf is unloaded and example.swf is loaded. On second button click again, example.swf is unloaded and importer.swf is loaded, here i am getting issues shown above.
    Attemping to launch and connect to Player using URL D:\runtime issue\loader.swf
    [SWF] D:\runtime issue\ loader.swf - 8181 bytes after decompression
    [SWF] D:\runtime issue\example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    [SWF] D:\runtime issue\importer.swf - 441708 bytes after decompression
    [SWF] D:\runtime issue\ example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\ example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    ReferenceError: Error #1065: Variable xxxxxx is not defined.
    Debug session terminated.
    Code i am using
    b1.addEventListener(MouseEvent.CLICK, b1Clicked);
    b2.addEventListener(MouseEvent.CLICK, b2Clicked);
    var ldr:Loader;
    function b2Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("importer.swf"));
        addChild(ldr);
    function b1Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("example.swf"));
        addChild(ldr);
    If i try to open the swf using IE, i am not getting any issues at all. But i need to open this loader.swf in a air application. Also when i use loaderContext for the loader instance i am able to get rid of this issue but i cant use it in my application.
    So, please help me in resolving this issue.
    Thanks

    I got my answer. I had to append the photo url to the 'movie' value of the javascript embed method. Like this:
    <script language="JavaScript" type="text/javascript">
       AC_FL_RunContent(
          'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
          'width', '550',
          'height', '400',
          'src', 'lesson2',
          'quality', 'high',
          'pluginspage', 'http://www.adobe.com/go/getflashplayer',
          'align', 'middle',
          'play', 'true',
          'loop', 'true',
          'scale', 'showall',
          'wmode', 'window',
          'devicefont', 'false',
          'id', 'lesson2',
          'bgcolor', '#ffffff',
          'name', 'lesson2',
          'menu', 'true',
          'allowFullScreen', 'false',
          'allowScriptAccess','always',
          'movie', 'lesson2?photo=http://www.flash-mx.com/images/image1.jpg',
          'salign', ''
          ); //end AC code
    </script>
    Thanks,
    srb.

  • Load remote content in messages (Mail)

    Hello All,
    Iv'e just upgraded to Yosemite today, and so far, so good, a few teething issues.
    The biggest problem I have is with the Mail App.
    I just can't get to see remote contant in Mail messages (using my Apple iCould account)
    I had no problems in Mavericks, did a straight upgrade.  I have tried Preferences -> Viewing -> Load Remote Content in Messages,, but the images in messages just won't show.  I am being presented with little boxes and question marls in the place holders of the images.
    I have tried to toggle on/off whilst restarting the mail app, but no joy.  This is a real deal breaker for me, as mail is probably the main app I use.  And having to click the links to open the image in a web browser is a show stopper.
    Any help here would be much appreciated, just to add, I had no problems with the Mavericks mail app. This is installed on my Mac Pro (mid 2012) and I'm reluctant to upgrade on my Macbook Air at the moment.

    Bingo!
    Stupid me… This was the reason it didn't work for me. Thanks!
    The rule in Little Snitch that broke the images was this one:
    /Applications/Mail.app/Contents/MacOS/Mail
    Deny any outgoing connection
    Process Owner:  Me
    On 06/02/2014, Mail tried to establish a connection to static.avast.com on port 80 (http). The request was denied via connection alert.
    I guess Mac OS X 10.10 somehow toggled this rule!?
    Thanks again, the rule has now been deleted :-)
    /Peter

  • Problem in loading secondary swf

    Hi,
    I am trying load a font as swf for IOS application.i tried load to it from both application directory and application storage directory.but it always throws the following error.
    Fast debuging mode everything works fine.
    Air Sdk 3.8
    Flash Builder 4.7
    swf version 20
    Error 3747: Multiple application domains are not supported on the operating system.
    Code i used to load the swf.
    var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain,null);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fontLoadComplete);
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    var strPath:String = "assets/fonts/font.swf"
    var urlReq: URLRequest = new URLRequest();
    urlReq = strPath;
    loader.load(urlReq, context);
    please correct me if i am doing any thing wrong in loading swf with as3 code.
    Regards,
    Saravanan

    Hi Nimit,
    Sorry for late reply.
    Actually problem is in my side.I am loading two swfs one with code in side another without code.
    I used loader content for only swf containing code inside but both the swfs requires to specify the loader content to same application domain.
    Its working fine after set the loader content to both swfs.
    sorry for trouble and thanks for the response.
    Regards,
    Saravanan.G

Maybe you are looking for

  • Enter and Ctrl-Enter stopped working in the address bar since 3.6.13

    Since 3.6.13, Enter and Ctrl-Enter no longer do anything at all in my address bar in Firefox. I uninstalled Firefox (including all user settings and preferences) and reinstalled fresh, and was amazed to see that the problem is still the same. If I ty

  • BW7.0  Classification System

    Hi Everybody, in NW2004s BI (BW7.0) there is an option <i>Cross Application Components -> Classification System</i> What does <b>Classification System</b> do? some interesting links.. Thanks Regards FedeX

  • Export DNS cache

    After searching around, I've found a ton of posts about clearing DNS Cache, but what I'm actually looking for is a way to export the DNS cache out of bind to some sort of text file. Basically, I'm hoping to build a static dns cache lookup file to use

  • Can i use my usa itunes account in another country?

    I am thinking of traveling and want to be able to access my itunes account for updates and purchases. I will be going to peru and want to see if i will have any problems.

  • Problems syncing - no connection, yet I see the unti in iTunes

    Hello, I see the AppleTV under the device list in iTunes...on the AppleTV device, it confirms it's on the network with a strong signal ...It's been working well for months, and then all of a sudden this week (no software upgrades involved) when I hit