2 Replies Latest reply on Jul 22, 2006 12:34 PM by kglad

    clearInterval/ setInterval

    jonnybennett Level 1
      I am creating a picture viewer, this is the scripting for the onRelease thumnails that load a largePic. The first time you press the thumnail the setInterval doesn't start until the onLoadInit, however the next thumnail you press starts the setInterval actions before the onLoadInit. AnyIdeas why?

      thisTimeline["pResults"+p].onRelease= function(){
      test.text='';
      clearInterval(myInterval);
      clearInterval(myInterval2);
      maskage._height=5;
      maskage._width=5;
      var myLoader = new MovieClipLoader();
      var myListener = new Object();
      myListener.onLoadInit = function(target:MovieClip){
      _global.globalWidth=target._width;
      _global.globalHeight=target._height;
      target.setMask(maskage);
      test.text='loaded';
      var myInterval:Number=setInterval(animMove,1);
      var myInterval2:Number=setInterval(animMask,1);}
      myLoader.loadClip('pictures/'+this.invis.pic.text,'picLarge');
      myLoader.addListener(myListener);
      }