5 Replies Latest reply on Jul 29, 2011 4:00 PM by Flex harUI

    .hasDefinition no longer working when I move .swf movie to a diff directory

    SPGAnne Level 1

      I am on Flex 3.6 (Sorry, the move to 4.5 is just too darn difficult right now as I am on a tight deadline and I ran into many many migration issues).

       

      For years I have used the following code in a component I made that subclasses SWFLoader and it works just dandy fine:

       

       

      var mClip:MovieClip;

      var swfAppDomain:ApplicationDomain = this.loaderContext.applicationDomain;

      if (swfAppDomain.hasDefinition(symbolLinkName)){

       

      var classRef:Class = swfAppDomain.getDefinition(symbolLinkName) as Class;

      mClip = new classRef();

      }

      }

       

      The .swf's I am loading with the SWFLoader contain various animation MovieClips that I created in Flash CS4 and are stored in the library of that animations.swf.  When I keep the animations.swf in the relative path of the Flex app MyApp.swf  (i.e. I have a folder myApp which has the Flex app MyApp.swf and a folder called assets which has the animations.swf) all works fine.  As soon as I move the assets folder to a different folder that is outside the myApp folder foodchain, the .hasDefinition no longer works.  That is, the hasDefinition() can't find my animation in the library of the animiations.swf

       

      What on earth could be the issue?  I don't get any exceptions or error messages.  I just don't get the MovieClips out of the library.