0 Replies Latest reply on Aug 28, 2006 2:59 PM by beevyarr

    Trouble w/ Globals

    beevyarr Level 1
      I've been trying to dynamically load images through MovieClipLoader class. Once an image is fully loaded, I will fade it up and then load the next image. Problem is, I want to put a timer on the image once it is loaded, so that the next image has time to load, but doesn't necesarrily fade up too quickly.

      I'm trying to stream the images one after another, so that online viewers will not have to wait for all to load at once, but once the swf is cached, I don't want the images to all load almost at once.

      Below is my code, trying to declare a checkTime function, then assiging values to its variables from within the MCL functions. It is obviously not working. I need to call the checkTime funtion outside of the MCL functions, but where?
      I will try a Listener, now, but any other suggestions for my horrible code will be appreciated.
      ////////////////////////////////////////////////////////////////////
      var delay = 2000;
      function checkTime() {
      if (currentTime - startTime >= delay) {

      // LOAD NEXT _mcl //
      one_mcl.loadClip("imgsLarge/1.jpg","1_mc")
      };

      }

      clip_mcl.onLoadStart = function (targetMC) {
      var loadProgress = clip_mcl.getProgress(targetMC);
      _global.startTime = getTimer();[/]

      // fade up picture, fade out loader.
      clip_mcl.onLoadInit = function (targetMC) {
      targetMC._alpha = 0;
      targetMC.onEnterFrame = function() {
      this._alpha += 2.5;
      _global.currentTime = getTimer();
      }
      if(this._alpha >= 100) {
      checkTime();
      }
      load_mc.onEnterFrame = function() {
      this._alpha -= 2.5;
      }
      };

      clip_mcl.loadClip("imgsLarge/0.jpg","0_mc");