16 Replies Latest reply on Dec 3, 2006 8:51 PM by Angel3m

    URGENT ----- EXTERNAL SWF POSITION

    Angel3m

      Hi all, im a newbie, just coming to the point.... got headache by googling arround the solution.
      i made 2 files

      1. main
      2. logo
      --------------------
      in main, loading the logo.swf

      i put an actionscript in a timeline frame, n that is:

      loadMovieNum ("logo/logo.swf",1);

      n its loading the logo.swf.

      but its on left side, i want it on a certain position...
      i want that the main movie loads n then the external movies loads but on the position that i will give....

      any guidance or help, on this way, plz


      Regards

        • 1. Re: URGENT ----- EXTERNAL SWF POSITION
          kglad Adobe Community Professional & MVP
          AFTER loading is complete you can use _level1._x and _level1._y to control the _x and _y properties of logo.swf.
          • 2. Re: URGENT ----- EXTERNAL SWF POSITION
            Level 7
            Align the used level.


            loadMovieNum("logo/logo.swf",1);

            this.createEmptyMovieClip("listenerLevel1", this.getNextHighestDepth());
            listenerLevel1.onEnterFrame = function(){
            _level1._x = 100; _level1._y = 100;
            if(_level1 != undefined) delete listenerLevel1.onEnterFrame;
            };



            This script is bad, use MovieClipLoader Class.


            var listenerLoader:Object = new Object();
            var mcLoader:MovieClipLoader = new MovieClipLoader();
            mcLoader.addListener(listenerLoader);

            this.createEmptyMovieClip("mcLogo", this.getNextHighestDepth());
            mcLogo._x = 100;
            mcLogo._y = 100;

            mcLoader.loadClip("logo/logo.swf", mcLogo);



            --
            Erick Souza
            www.ericksouza.com
            • 3. URGENT ----- EXTERNAL SWF POSITION
              Angel3m Level 1


              THANX ALOT Erick

              It WORKED. Thnx for your HELP GUYz

              • 4. Re: URGENT ----- EXTERNAL SWF POSITION
                Level 7


                kglad wrote:
                > AFTER loading is complete you can use _level1._x and _level1._y to control the _x and _y properties of logo.swf.

                You can also place this._x=123; and this._y=123; in the first frame of the "loaded" movie.
                It will positions itself automatically as soon as its first frame get loaded.
                --
                Best Regards

                Urami


                --


                <urami>
                If you want to mail me - DO NOT LAUGH AT MY ADDRESS
                </urami>
                • 5. Re: URGENT ----- EXTERNAL SWF POSITION
                  Angel3m Level 1
                  Thanx guys for kind help

                  ummmmm.......

                  another Question plz,

                  If I have more than 1 External movies, loading in the same main, like:

                  >> main
                  external 1. logo
                  external 2. web
                  external 3. Card

                  and so

                  then what i suppose to do, or what code it will be?

                  Regards
                  • 6. Re: URGENT ----- EXTERNAL SWF POSITION
                    Level 7
                    You can use new levels:

                    loadMovieNum ("logo/logo.swf",1);
                    this.createEmptyMovieClip("listenerLevel1", this.getNextHighestDepth());
                    listenerLevel1.onEnterFrame = function(){
                    _level1._x = 29; _level1._y = 15;
                    if(_level1 != undefined) delete listenerLevel1.onEnterFrame;
                    };

                    loadMovieNum ("web.swf",2);
                    this.createEmptyMovieClip("listenerLevel2", this.getNextHighestDepth());
                    listenerLevel2.onEnterFrame = function(){
                    _level2._x = 29; _level2._y = 15;
                    if(_level2 != undefined) delete listenerLevel1.onEnterFrame;
                    };


                    But using the MovieClipLoader Class is much simpler.

                    var listenerLoader:Object = new Object();
                    var mcLoader:MovieClipLoader = new MovieClipLoader();
                    mcLoader.addListener(listenerLoader);


                    this.createEmptyMovieClip("mcLogo", this.getNextHighestDepth());
                    mcLogo._x = 100; mcLogo._y = 100;
                    mcLoader.loadClip("logo/logo.swf", mcLogo);


                    this.createEmptyMovieClip("mcWeb", this.getNextHighestDepth());
                    mcWeb._x = 100; mcWeb._y = 100;
                    mcLoader.loadClip("web.swf", mcWeb);


                    this.createEmptyMovieClip("mcCard", this.getNextHighestDepth());
                    mcCard._x = 100; mcCard._y = 100;
                    mcLoader.loadClip("card.swf", mcCard);

                    --
                    Erick Souza
                    www.ericksouza.com
                    • 7. Re: URGENT ----- EXTERNAL SWF POSITION
                      Level 7
                      Correction of the second load, that deletes the onEnterFrame.

                      if(_level2 != undefined) delete listenerLevel2.onEnterFrame;



                      loadMovieNum ("web.swf",2);
                      this.createEmptyMovieClip("listenerLevel2", this.getNextHighestDepth());
                      listenerLevel2.onEnterFrame = function(){
                      _level2._x = 29; _level2._y = 15;
                      if(_level2 != undefined) delete listenerLevel2.onEnterFrame;
                      };


                      --
                      Erick Souza
                      www.ericksouza.com
                      • 8. URGENT ----- EXTERNAL SWF POSITION
                        Angel3m Level 1
                        How to use MovieClipLoader Class ? i just replace the MovieClipLoader Class with the old code place am i using it rite?
                        remember im a newbie

                        when i paste the folowing code id dose not show anything

                        var listenerLoader:Object = new Object();
                        var mcLoader:MovieClipLoader = new MovieClipLoader();
                        mcLoader.addListener(listenerLoader);


                        this.createEmptyMovieClip("mcLogo", this.getNextHighestDepth ());
                        mcLogo._x = 100; mcLogo._y = 100;
                        mcLoader.loadClip("logo/logo.swf", mcLogo);


                        this.createEmptyMovieClip("mcWeb", this.getNextHighestDepth());
                        mcWeb._x = 100; mcWeb._y = 100;
                        mcLoader.loadClip("web.swf", mcWeb);


                        this.createEmptyMovieClip("mcCard", this.getNextHighestDepth());
                        mcCard._x = 100; mcCard._y = 100;
                        mcLoader.loadClip("card.swf", mcCard);


                        n in the 1st code the 1st movie is not taking the place.... its stuck on the edges, 0,0 palce

                        waiting for reply

                        Regards
                        • 9. Re: URGENT ----- EXTERNAL SWF POSITION
                          Level 7
                          Hi Angel, which the purpose of this message?

                          Angel3m wrote:
                          > loadMovieNum ("logo/logo.swf",1);
                          >
                          > this.createEmptyMovieClip("listenerLevel1", this.getNextHighestDepth());
                          > listenerLevel1.onEnterFrame = function(){
                          > _level1._x = 29; _level1._y = 15;
                          > if(_level1 != undefined) delete listenerLevel1.onEnterFrame;
                          > };
                          >


                          --
                          Erick Souza
                          www.ericksouza.com
                          • 10. Re: URGENT ----- EXTERNAL SWF POSITION
                            kglad Adobe Community Professional & MVP
                            all your loaded swfs are going to overlap at 100,100. and you don't need the listener for this code.
                            • 11. Re: URGENT ----- EXTERNAL SWF POSITION
                              Level 7
                              kglad wrote:
                              > all your loaded swfs are going to overlap at 100,100. and you don't need the listener for this code.


                              The positions he is altering. Unless he puts the positions in the first
                              frame of the swf's, the lister is need.


                              --
                              Erick Souza
                              www.ericksouza.com
                              • 12. Re: URGENT ----- EXTERNAL SWF POSITION
                                kglad Adobe Community Professional & MVP
                                the _x and _y properties of a loadClip or loadMovie() or loadMovieNum() target, can be defined anytime after the target exists. no listener/preload checker is needed.
                                • 13. Re: URGENT ----- EXTERNAL SWF POSITION
                                  Level 7
                                  kglad wrote:
                                  > the _x and _y properties of a loadClip or loadMovie() or loadMovieNum() target, can be defined anytime after the target exists. no listener/preload checker is needed.

                                  In the example it is not exactly a listener, it is a movieclip for the
                                  onEnterFrame event.

                                  In the example it is necessary to use the oEnterFrame event to know when
                                  the object(new level) exists.

                                  The MovieClipLoader Class is much more powerful, but he uses the Flash
                                  MX ver.

                                  --
                                  Erick Souza
                                  www.ericksouza.com
                                  • 14. Re: URGENT ----- EXTERNAL SWF POSITION
                                    kglad Adobe Community Professional & MVP
                                    erick, can you not see the message angel posted on 12/03/2006 at 08:32:35 AM?
                                    • 15. Re: URGENT ----- EXTERNAL SWF POSITION
                                      Level 7


                                      Erick Souza wrote:
                                      > kglad wrote:
                                      >> the _x and _y properties of a loadClip or loadMovie() or
                                      >> loadMovieNum() target, can be defined anytime after the target
                                      >> exists. no listener/preload checker is needed.
                                      >
                                      > In the example it is not exactly a listener, it is a movieclip for the
                                      > onEnterFrame event.
                                      >
                                      > In the example it is necessary to use the oEnterFrame event to know when
                                      > the object(new level) exists.
                                      >
                                      > The MovieClipLoader Class is much more powerful, but he uses the Flash
                                      > MX ver.

                                      All this is real overkill of some really fundamental flash functionality.
                                      Just as kglad said, it's not required, enterframe loops nor loader classes etc...
                                      Pure over kill...


                                      --
                                      Best Regards

                                      Urami


                                      --


                                      <urami>
                                      If you want to mail me - DO NOT LAUGH AT MY ADDRESS
                                      </urami>
                                      • 16. Re: URGENT ----- EXTERNAL SWF POSITION
                                        Angel3m Level 1


                                        LADIES N GENTEL PEOPLES

                                        THE PROBLEM IS SOLVED

                                        Here what i did:

                                        In all external files i put this code (instead of 100, i put the desired location) for each:
                                        Remember Each External file location Should match the location in Main file

                                        this._x = 100;
                                        this._y = 100;

                                        and in the main file as ERICK ( THNX A LOT ) wrote the code:

                                        loadMovieNum ("sub/logo.swf",1);
                                        this.createEmptyMovieClip("listenerLevel1", this.getNextHighestDepth());
                                        listenerLevel1.onEnterFrame = function(){
                                        _level1._x = 100; _level1._y = 100;
                                        if(_level1 != undefined) delete listenerLevel1.onEnterFrame;
                                        };


                                        loadMovieNum ("sub/web.swf",2);
                                        this.createEmptyMovieClip("listenerLevel2", this.getNextHighestDepth());
                                        listenerLevel2.onEnterFrame = function(){
                                        _level2._x = 200; _level2._y = 200;
                                        if(_level2 != undefined) delete listenerLevel2.onEnterFrame;
                                        };


                                        loadMovieNum ("sub/card.swf",3);
                                        this.createEmptyMovieClip("listenerLevel3", this.getNextHighestDepth());
                                        listenerLevel3.onEnterFrame = function(){
                                        _level3._x = 300; _level3._y = 300;
                                        if(_level3 != undefined) delete listenerLevel3.onEnterFrame;
                                        };



                                        This is all, GENTEL PEOPLES

                                        Thank You all for kind Support