13 Replies Latest reply on Feb 26, 2008 12:07 PM by kglad

    can.t work out buttons in swf

    micgamb
      Hallo everybody,
      maybe for most of yo this is the easiest problem but for me it is a nightmare..

      I am using buttons to import in a holder MovieClip a MOvieclip which contains buttons that should limport another MCL in the holder instead of the previous MCL.
      Nothing seems to work.

      to import the MCL in the first place I am using this script:

      b1.onRelease = function () {
      loader._visible = true
      mcl.loadClip("parentesi mobili.swf", holder2);
      }

      which works fine. I did try to apply the same code to the button in the imported MCL but nothing happen. then I have written the same code changing the name of the button (b1) with the one imported and placed in the main stage "actions" frame. Nothing

      Please help me
      thank you so much
        • 1. Re: can.t work out buttons in swf
          kglad Adobe Community Professional & MVP
          if parentesi mobili.swf (which you should rename so it has no space) has a button that's trying to load another swf into holder2, you need to reference the main timeline of parentesi mobili.swf instead of holder2.
          • 2. Re: can.t work out buttons in swf
            micgamb Level 1
            quote:

            Originally posted by: kglad
            if parentesi mobili.swf (which you should rename so it has no space) has a button that's trying to load another swf into holder2, you need to reference the main timeline of parentesi mobili.swf instead of holder2.


            Thank you
            could you be a little bit more specific? I have understood that I have to write the ActionScript in the parentesi mobili.swf. But how? My main timeline is called "artprov".

            "artprov" has a button that triggers an external MCL which has inside in another holder the "parentesi mobili.swf". As you have fully understood "parentesi mobili.swf" has a button tha should load the MCL "descrizione.swf" into the main stage. Why should I refer to the main timeline and not on the holder2 MCL?

            thank you s much
            • 3. Re: can.t work out buttons in swf
              kglad Adobe Community Professional & MVP
              you can use an absolute path or relative path to reference holder2. if the path is relative, you can use your reference to the main timeline of parentesi mobili.swf. if the path is absolute, you can use _level0.path.holder2. it can't be determined what path should be from the information you've supplied.

              but if holder2 is on the main timeline of your main swf, you can just use _level0.holder2 from anywhere to reference that target movieclip.

              if the main timeline of parentesi mobili.swf can be referenced by artprov (ie, you have on parentesi mobili.swf's main timeline):

              • 4. Re: can.t work out buttons in swf
                micgamb Level 1
                Thank you, to be more specific:

                this is the code that i am using in the main menu:

                var mcl:MovieClipLoader = new MovieClipLoader ();
                var mclL:Object = new Object ();

                mclL.onLoadProgress = function (target,loaded,total) {
                loader.percent.text = Math.round ((loaded/total) * 100) +"%";
                }

                mclL.onLoadInit = function () {
                loader._visible = false;
                loader.percent.text ="";

                }

                mcl.addListener(mclL)


                b1.onRelease = function () {
                loader._visible = true
                mcl.loadClip("parentesi mobili.swf", holder2);
                }


                stop();

                where, obviously, b1,b2.b3 are the button names.
                I will try to explain:

                main stage ("artprov") where b1-b2... are placed

                b1 triggers a MCL called "parentesi mobili.swf" and place it into a Holder MCL in the main stage.

                the "parentesi mobili.swf" MCL is divided in 3 Holder MCL where another 3 MCL are imported. When I click "b1" it imports the external swf "parentesi mobili.swf" in the Holder MCL and at the same time "parentesi mobili.swf" import the 3 MCL("michela.swf",Easy.swf","tee.swf") inside its Holder MCL.

                The problem is that when everything is loaded on main stage the buttons inside "michela.swf" doesn't work.
                that button should load another external MCL inside the main stage or inside the "parentesi mobili.swf".
                if I am using the _level0.holder2 where and how do I attach the code?
                I hope you did understand almost everything
                thank you so much
                • 5. Re: can.t work out buttons in swf
                  kglad Adobe Community Professional & MVP
                  what moviecliploader is michela using (and where's it located) and what target movieclip is michela using (and where's it located)?
                  • 6. Re: can.t work out buttons in swf
                    micgamb Level 1
                    i did used the actionscript the I am using in the main menu :
                    michela.swf has a button called "michela" so:

                    michela.onRelease = function () {
                    loader._visible = true
                    mcl.loadClip("descrizione michela.swf", holder2);
                    }

                    I do not know anything about "target" . the code that I'am for the main timeline it is written in the previous post. Apart from that I do not know whic Actionscript will work in the imported movieClip. The "michele" button it is located inside the MCL"michela.swf" imported into "portfolio.swf". Holder2 it is referred to the main stage (artprov).

                    I am aware that sounds confused but I do not know how to explain it in a more clear manner.
                    thank so much

                    • 7. Re: can.t work out buttons in swf
                      kglad Adobe Community Professional & MVP
                      prefix mcl with _level0 and prefix holder2 with _level0, IF mcl is on the _level0 main timeline and holder2 is on the _level0 main timeline.
                      • 8. Re: can.t work out buttons in swf
                        micgamb Level 1
                        I did what you have told me:

                        michela.onRelease = function () {
                        loader._visible = true
                        _level0.mcl.loadClip("descrizione michela.swf", _level0.holder2);
                        }
                        It is not working, probably I did write the code wrongly....
                        could please correct it ??
                        thank you
                        • 9. Re: can.t work out buttons in swf
                          kglad Adobe Community Professional & MVP
                          no, that's correct. so, if that didn't work you can conclude that either mcl is not on the main timeline of _level0 and/or _level0.holder2 is not on the timeline of _level0.

                          to find out which, use:

                          trace(this+" "+this.mcl); //below the code that instantiates mcl

                          and use:

                          trace(holder2); // on the timeline that contains holder2

                          • 10. Re: can.t work out buttons in swf
                            micgamb Level 1
                            Sorry I did it but I do not know what to do...

                            now the button is


                            michela.onRelease = function () {
                            loader._visible = true
                            _level0.mcl.loadClip("descrizione michela.swf", _level0.holder2);
                            }

                            trace(this+" "+this.mcl);

                            I think the problem remains that the MCL "michela.swf" is loaded in "portfolio" and "portfolio" is loaded in the main timeline.If I place a simple button in "portfolio" it works with the above script but it loads the MCL inside "portfolio" not in the main time line. I think that even if "michela.swf", through the "portfolio"MCL, is loaded on main stage it is separated in some way.

                            reasumy: "holder2" to is on main line. "michela.swf"in loaded in Portfolio" whic is loaded onto "Holder2".
                            thank yo for your patience
                            • 11. Re: can.t work out buttons in swf
                              kglad Adobe Community Professional & MVP
                              follow the instructions:

                              //below the code that instantiates mcl (ie, where you have mcl=new MovieClipLoader() ) type:

                              trace(this+" "+this.mcl);

                              // and find the holder2 movieclip in the authoring environment. in the actions panel type:

                              trace(holder2);
                              • 12. Re: can.t work out buttons in swf
                                micgamb Level 1
                                Still nothing ..I did write the trace() code in the actions o the "michela.swf" and on the main timeline "trace(holder2)" but in in the output pannel nothing appeared...I am very stuck.

                                thisi the code on the main timeline:

                                var mcl:MovieClipLoader = new MovieClipLoader ();
                                var mclL:Object = new Object ();
                                trace(holder2);

                                mclL.onLoadProgress = function (target,loaded,total) {
                                loader.percent.text = Math.round ((loaded/total) * 100) +"%";
                                }

                                mclL.onLoadInit = function () {
                                loader._visible = false;
                                loader.percent.text ="";

                                }

                                mcl.addListener(mclL)


                                b1.onRelease = function () {
                                loader._visible = true
                                mcl.loadClip("parentesi mobili.swf", holder2);
                                }


                                and this in the michela .swf actions timeline:

                                var mcl:MovieClipLoader = new MovieClipLoader ();
                                var mclL:Object = new Object ();
                                trace(this+" "+this.mcl);

                                mclL.onLoadProgress = function (target,loaded,total) {
                                loader.percent.text = Math.round ((loaded/total) * 100) +"%";
                                }

                                mclL.onLoadInit = function () {
                                loader._visible = false;
                                loader.percent.text ="";

                                }

                                mcl.addListener(mclL)


                                michela.onRelease = function () {
                                loader._visible = true
                                mcl.loadClip("descrizione michela.swf", holder2);
                                }

                                stop();

                                thanks

                                • 13. Re: can.t work out buttons in swf
                                  kglad Adobe Community Professional & MVP
                                  find the timeline that contains holder2 and place that trace(holder2) on that timeline.