13 Replies Latest reply on Nov 4, 2006 1:57 PM by kglad

    controling a loaded swf into movieClip

    Goshine
      help!!
      i have loaded a {slide swf} into a movieClip .. on stage .. using the
      var loader:MovieClipLoader();
      using a button movie clip the is embeded into a seperate swf file that is loaded in at run time
      but the {slide swf} is runing a Interval that i need to clare ... so is there a way to talk to swf file after you load it into a movie Clip how do you address that
        • 1. Re: controling a loaded swf into movieClip
          kglad Adobe Community Professional & MVP
          if the interval in your external swf is intervalNameI, it's on the main timeline and you load your external swf into _level0.holderMC, you can clear you interval using:

          • 2. Re: controling a loaded swf into movieClip
            Goshine Level 1
            Kglad ... it work's like a charm....{clearInterval(_level0.holderMC.intervalNameI);}

            i have a next little issue
            which is
            a slide show thing ;; in my {slide show swf} i am loading in some jpg images .. with a XML file .. into an Array and and then use the Array to feed my {slide show swf}
            but when i create a loop that ++ the {slide show swf}
            it just snap to the other picture ... is there a way to make a smooth easing transition from image to image .....
            • 3. Re: controling a loaded swf into movieClip
              kglad Adobe Community Professional & MVP
              yes, you can use the tween class or write your own easing equation.

              to use the tween class check the flash help files - search for "tween(" - and start with "using the tween class" under "components language reference".

              to write your own you can use something like:

              • 4. Re: controling a loaded swf into movieClip
                Goshine Level 1
                yes >> Kglad did a little reding on the topic ... but it ha only lead me deeper into confusion.... this is my next button.. that i use to ++ my slidshow ...i am tying to incorperate a method into this ,that can fade the transition into the next image to be loaded next.onRelease = function() {
                if (whoIsOn<urls.length-1) {
                whoIsOn++;
                holder.loadMovie(urls[whoIsOn]);
                caption.text = captions[whoIsOn];
                caption2.text = captions2[whoIsOn];
                }
                };
                • 5. Re: controling a loaded swf into movieClip
                  kglad Adobe Community Professional & MVP
                  what is it that you want to do? do you want to fade-out the current holder, load the and fade-in the next?

                  note: if yes to the above there will probably be a delay between the fade-out and the fade-in while loading is taking place.
                  • 6. Re: controling a loaded swf into movieClip
                    Goshine Level 1
                    yes that is exactly what i want to do .... can you show how to get it to happen
                    • 8. Re: controling a loaded swf into movieClip
                      Goshine Level 1
                      var kglad : Master = new Master();
                      Kglad .onReply=function(){
                      " you are on to somthing big [ only the second picture fade in and thats where it stop ] it deos not seem to bee loading any more ... but when you click the next _btn.
                      the caption keep changing ... but pictures don't change "........ i am sending you a better view of what ihave done<<<<<<<<<<start... // create variables
                      var x:XML = new XML();
                      x.ignoreWhite = true;
                      var urls:Array = new Array();
                      var captions:Array = new Array();
                      var captions2:Array = new Array();
                      var whoIsOn:Number;
                      //XMl function
                      x.onLoad = function() {
                      var photos:Array = this.firstChild.childNodes;
                      for (i=0; i<photos.length; i++) {
                      urls.push(photos .attributes.url);
                      captions.push(photos
                      .attributes.caption);
                      captions2.push(photos .attributes.caption2);
                      }
                      holder.loadMovie(urls[0]);
                      caption.text = captions[0];
                      caption2.text = captions2[0];
                      whoIsOn = 0;
                      };
                      //Load XML
                      x.load("pics/kingslandMarks/lmlist.xml");
                      // The Button envents
                      previous.onRelease = function() {
                      clearInterval(nInterval);
                      if (whoIsOn>0) {
                      whoIsOn--;
                      holder.loadMovie(urls[whoIsOn]);
                      caption.text = captions[whoIsOn];
                      caption2.text = captions2[whoIsOn];
                      }
                      };
                      next.onRelease = function() {
                      if (whoIsOn<urls.length-1) {
                      whoIsOn++;
                      clearInterval(transitionI);
                      transitionI = setInterval(transitionF, 50, wholsOn);
                      caption.text = captions[whoIsOn];
                      caption2.text = captions2[whoIsOn];
                      }
                      };
                      function transitionF(index) {
                      if (!fadedOut) {
                      holder._alpha -= 4;
                      if (holder._alpha<0) {
                      fadedOut = 1;
                      holder._visible = 0;
                      }
                      } else {
                      if (!loadStart) {
                      holder.loadMovie(urls[whoIsOn]);
                      loadStart = 1;
                      }
                      if (!loadComplete) {
                      if (holder.getBytesLoaded()>0 && holder.getBytesLoaded()>=holder.getBytesTotal()) {
                      holder._visible = true;
                      loadComplete = 1;
                      holder._alpha = 0;
                      }
                      } else {
                      holder._alpha += 4;
                      if (holder._alpha>=100) {
                      clearInterval(transitionI);
                      }
                      }
                      }
                      }
                      /*next.onRelease = function() {
                      clearInterval(nInterval);
                      if (whoIsOn<urls.length-1) {
                      whoIsOn++;
                      holder.loadMovie(urls[whoIsOn]);
                      caption.text = captions[whoIsOn];
                      caption2.text = captions2[whoIsOn];
                      }
                      };*/
                      var s;
                      //Experimenting with auto play slide show
                      var nInterval:Number;
                      autoPlay();
                      function autoPlay() {
                      function neXt():Void {
                      if (whoIsOn<urls.length-1) {
                      whoIsOn++;
                      holder.loadMovie(urls[whoIsOn]);
                      caption.text = captions[whoIsOn];
                      caption2.text = captions2[whoIsOn];
                      }
                      if (whoIsOn == urls.length) {
                      clearInterval(nInterval);
                      whoIsOn = 1;
                      }
                      }
                      /**/
                      function prEv() {
                      if (whoIsOn>0) {
                      whoIsOn--;
                      holder.loadMovie(urls[whoIsOn]);
                      caption.text = captions[whoIsOn];
                      caption2.text = captions2[whoIsOn];
                      }
                      }
                      auto.onRelease = function() {
                      nInterval = setInterval(neXt, 2000);
                      this._visible = false;
                      sTop._visible = true;
                      if (whoIsOn<urls.length-1) {
                      whoIsOn++;
                      holder.loadMovie(urls[whoIsOn]);
                      caption.text = captions[whoIsOn];
                      caption2.text = captions2[whoIsOn];
                      }
                      };
                      sTop.onRelease = function() {
                      clearInterval(nInterval);
                      this._visible = false;
                      auto._visible = true;
                      };
                      }
                      //try to fade the movieClip holder
                      function fade():Void {
                      holder._alpha -= 5;
                      if (holder._alpha == 20) {
                      holder._alpha = 100;
                      }
                      }
                      • 9. Re: controling a loaded swf into movieClip
                        kglad Adobe Community Professional & MVP
                        that's my fault. change the next handler to:

                        • 10. Re: controling a loaded swf into movieClip
                          Goshine Level 1
                          var kglad : Master = new Master();
                          Kglad .onReply=function(){
                          yes sirrrrrrrrrrrrrrrrrrrrrrrr....you got that right ...we are in !!!
                          but i tyr to use the same block of code into my [autoPlay();]
                          but it seems to be clashing with the other interval [ nInterval]
                          so right now the neXt_btn . is flawless ly smooth the transition from image to image
                          is great ....take a look at the auto play function in that block of code you will see where i use a little of the code from the neXt_btn... that much i try to replace .. but the result was crazy ....the slide show ( ran past quickly blinking the pictures at me one at time with a faded wink! { none of them was (_alpha = 100)}};
                          • 11. Re: controling a loaded swf into movieClip
                            kglad Adobe Community Professional & MVP
                            prior to all your setInterval() function statements, insert a clearInterval() so you have no conflicts.
                            • 12. controling a loaded swf into movieClip
                              Goshine Level 1
                              kool thanks for the support ...in a few day i would like to give you a preview of my website ,, and you could get to see my slide show s in action ...... .. the domain is
                              www.whatsinjamaica.com ... if you give mi your contact details i will tell you when to
                              view the site ....
                              which ever one you use
                              • 13. Re: controling a loaded swf into movieClip
                                kglad Adobe Community Professional & MVP
                                post here when your site is ready. that way other thread followers can check it too.