2 Replies Latest reply on Jun 29, 2010 1:37 AM by Flash@dicts

    How can attach movieclip in run time




      Getting some problem to attach movieclip at run time...............


      I have a shell.swf and at run time i am attaching a template.swf. In template.swf file have mcMenu Movieclip.
      I am unable to access the or attach the movieclip at run time getting this error  (1180: Call to a possibly undefined method mcMenu.)

      that movieclip is not available on the stage.... it is in the library of template.swf file. Need help


      thanks in advance


        • 1. Re: How can attach movieclip in run time
          kglad Adobe Community Professional & MVP

          use the applicationdomain class:




          // you don't need to change anything below:
          function load(urlS:String, classS:String) {
              var ldr:Loader = new Loader();
              ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event){loadCompleteF(e,classS);});
              ldr.load(new URLRequest(urlS));


          function loadCompleteF(e:Event,classS:String):void {
              var loadedAppDomain:ApplicationDomain = e.target.content.loaderInfo.applicationDomain;
              var C:Class = loadedAppDomain.getDefinition(classS) as Class;
              var instance:* = new C();

          1 person found this helpful
          • 2. Re: How can attach movieclip in run time
            Flash@dicts Level 1



            I have no any class in loaded swf.....i want to attach a movieclip on in shell which is available in the loaded swf that is mcMenu. Can i access without any other class which is in the template.swf. Because I have only a controller.as file which i want to use to do that.........plz guide me