2 Replies Latest reply on Feb 3, 2008 3:35 AM by Tareq AlJaber

    Loading a swf into a movie clip

    La Bestia Level 1
      Hey guys, in Actionscript 2.0 loading a swf into a movie clip would be nothing more than the loadMovie command. Here it is a bit different. I searched on google for a while and ran into this:

      var myRequest:URLRequest = new URLRequest("external.swf");
      var myLoader:Loader = new Loader();
      myLoader.load(myRequest);
      content_mc.addChild.(myLoader);

      What happen to the insert code button? Oh, well. this does not load the external.swf unless directly on the stage. It does not load it inside content_mc at all. Any ideas? Also I have a preloader on frame 1 is there a way that this can load on completion of the preloader? Ideas? Thanks everyone.
        • 1. Re: Loading a swf into a movie clip
          AS3dev
          We'll need some more info to really pinpoint the problem, but here are some things to check:
          1) If you are using Flex make sure the url is relative to the project rather than to the as class or mxml document.
          2) Make sure content_mc is on the stage (if you are using Flash) or is an mxml component (if you are using Flex) or is added using addChild(content_mc).
          3) To debug what exactly is going wrong, add event listeners for each of the events that can be dispatched by the contentLoaderInfo property of your Loader instance (myLoader.contentLoaderInfo). See Class LoaderInfo for the list of events.
          • 2. Re: Loading a swf into a movie clip
            Tareq AlJaber Employee Moderator
            How About you use Embed metadata. It is very easy , check this out :

            [Embed(source="SWF name ")]
            var myObj:Class;

            var display:DisplayObject = new myObj();

            content_mc.addChild(display);


            Hope this helps

            tareq