0 Replies Latest reply on Dec 22, 2010 9:06 AM by Cuwen_26

    Timeline Control in Swf Array

    Cuwen_26

      First question!  I hope I can find help with this.

       

      I have made a main flash file to call my swf clips and play them in order.  I used an array for this, but now I'm wondering how I can create controls for the timeline when the swf clip is being called from a different location, not on the actual timeline that the timeline controls would be on.  I'd like to put the controls on the main flash file that calls the swfs, not on each individual swf clip.  Make sense?  Here is my code:

       

          var currentSwf:Number = 0;
          var swfs:Array = new Array("Bobcat/snow.swf", "Bobcat/ice.swf", "Bobcat/tree.swf", "Bobcat/snow2.swf");

       

          var listener:Object = new Object();
          var mcl:MovieClipLoader = new MovieClipLoader();
          mcl.addListener(listener);

       

          // Function to load the "next" movie.  It uses the current value of currentSwf
          // to access the swfs array, then increments that value.  This version loops
          // around to the beginning after the last one.

       

          function loadNext():Void {
             mcl.loadClip(swfs[currentSwf],theTargetClip_mc);
             currentSwf++;
             if (currentSwf >= swfs.length) currentSwf = 0;
          }

       

          // When the swf loads, set it up to constantly check its current frame
          // against the total frames, and if those match, the swf is done playing.
          // If that's the case, then load the next one.

       

          listener.onLoadInit = function(targ:MovieClip):Void {
             theTargetClip_mc.onEnterFrame = function():Void {
                if (this._currentframe == this._totalframes) {
                   loadNext();
                   delete this.onEnterFrame;
                }
             }
          }

       

          loadNext();
          function loadNext():Void {
         if (currentSwf >= swfs.length) return;
         mcl.loadClip(swfs[currentSwf], theTargetClip_mc);
         currentSwf++;
        
      }

       

       

       

      So, any way to control the timeline here with control buttons?  I've looked for this on the internet and can't find one that controls swfs brought in from an external source for an array.