2 Replies Latest reply on May 1, 2011 10:42 PM by Rothrock

    PROBLEM TO LOADMOVIE SWF INTO FLASH

    melas076 Level 1

      dear ALL,

       

      I am facing a problem with LOADMOVIE.

       

      I did a MC called "bgproducts" on the root frame no:46 to 59 then stop();  and in this MC, you have an animation and stop at frame no :64 then stop();

      in the frame 64, i have another an empty MC called "productsMC".

      when i do this code in bgproduct frame no 64 :

       

      productsMC.loadMovie("main.swf", "");

       

      it plays the frame on the root 46 to 59 non-stop and nothing to loadmovie, and also the main.swf has a preoloader then frame 2 an load from xml file.

       

       

      thanks and i will appreciate your help!!!!!!!!

       

      MELAS

        • 1. Re: PROBLEM TO LOADMOVIE SWF INTO FLASH
          melas076 Level 1

          this is the preloader code of the main.swf in the first frame on the root:

           

          stop();
          //
          var xo:XML = new XML();
          xo.ignoreWhite = true;
          xo.onLoad = function() {
              _root.onEnterFrame = checkIfMovieLoaded;
          };
          function checkIfMovieLoaded() {
              if (_root.getBytesLoaded() == _root.getBytesTotal()) {
                  delete _root.onEnterFrame;
                  _root.gotoAndStop(2);
                  _root._visible = false;
              }
          }
          xo.load(xml == undefined ? "data.xml" : xml);

           

          i hope you understand this problems

           

          thanks and regards,

          MELAS

          • 2. Re: PROBLEM TO LOADMOVIE SWF INTO FLASH
            Rothrock Level 5

            I think this is what you want.

             

            stop();
            //
            var xo:XML = new XML();
            xo.ignoreWhite = true;
            xo.onLoad = function(success:Boolean) {

               if(success){
                    _root.gotoAndStop(2);
                    _root._visible = false;

                }
            };

            xo.load(xml == undefined ? "data.xml" : xml);

             

             

            The onLoad event for an XML file happens when the file is done loading, not when it starts loading.

             

            Of course I'm not sure why you would want to make the _root invisible. Since the root is the container for everything you will have nothing visible then.

             

            Also I'm not sure why you talk about loadmovie, that is for loading external swf, jpg, png, etc. And not XML.

             

            And even in your strange checkIfMovieLoaded() function why would you be trying to check the bytes loaded in the _root if you are loading xml or assuming you were actually trying to loadmovie?

            1 person found this helpful