4 Replies Latest reply on Apr 24, 2006 9:29 AM by blemmo

    Setting _xy coordinates using loadMovieNum() 

    westcountryphile
      Hello,

      I need some assistance with the following problem.

      I have a number of SWF files that can be loaded in response to the pressing of a specific button in a dynamic menu structure. This menu structure works ok. However when the movie displays it is positioned at 0,0 with the result that the display is partially obscured by the menu template. The code I have attempted to use to rectify this problem is:

      loadMovieNum(_level0.path+_level0.movieLoad+".swf", 20);
      _level20._y = 36;
      _level20._x = 16;

      The SWF files were created using Captivate and I have found that by converting them to FLA files it is possible to resolve this problem by updating the _y axis directly and re-publishing. However the importing of these files into Flash8, though successful, has resulted in the loss of certain features and a degradation in the quality of the movies. Therefore I would like to avoid having to resort to this solution if at all possible.

      I am new to flash8 and would be very grateful for any advice on this problem.

      Regards,

      Westcountryphile.




        • 1. Re: Setting _xy coordinates using loadMovieNum() 
          blemmo Level 1
          Hi,

          you have to wait until the loading is finished before you can set the position. Use preloader code for this or the MovieClipLoader class, which provides events that get triggered when loading is complete.

          hth,
          blemmo
          • 2. Re: Setting _xy coordinates using loadMovieNum() 
            westcountryphile Level 1
            Hello,

            Thanks for the advice.

            I have attempted to resolve the problem previously described using MovieClipLoader class but without success as the movie refuses to play.
            The code I have used is as follows:

            var mcLoader:MovieClipLoader = new MovieClipLoader();
            mcLoader.addListener(this);
            mcLoader.loadClip(_level0.path+_level0.movieLoad+".swf", 20);
            function onLoadComplete(mcLoader) {
            _level20._y = 36;
            _level20._x = 16;
            }

            The above code was devised from the example given in F1 Help. Any advice on what the correct syntax should be?

            Regards,

            westcountryphile

            • 3. Re: Setting _xy coordinates using loadMovieNum() 
              westcountryphile Level 1
              Hello,

              Thanks for the advice.

              I have attempted to resolve the problem previously described using MovieClipLoader class but without success as the movie refuses to play.
              The code I have used is as follows:

              var mcLoader:MovieClipLoader = new MovieClipLoader();
              mcLoader.addListener(this);
              mcLoader.loadClip(_level0.path+_level0.movieLoad+".swf", 20);
              function onLoadComplete(mcLoader) {
              _level20._y = 36;
              _level20._x = 16;
              }

              The above code was devised from the example given in F1 Help. Any advice on what the correct syntax should be?

              Regards,

              westcountryphile
              • 4. Setting _xy coordinates using loadMovieNum() 
                blemmo Level 1
                Hi,

                try this:
                --
                var loadListener:Object = new Object();
                loadListener.onLoadInit = function(target_mc:MovieClip):Void {
                target_mc._y = 36;
                target_mc._x = 16;
                }

                var mcLoader:MovieClipLoader = new MovieClipLoader();
                mcLoader.addListener(loadListener);
                mcLoader.loadClip(_level0.path+_level0.movieLoad+".swf", 20);
                --

                greets,
                blemmo