5 Replies Latest reply on Jul 29, 2009 5:58 AM by webqaflash

    Bit of help wanted

    SatropUK

      Hi all, so I have this script for a hoz scroller all work fine apartfrom all the thumbs are butted up against one another, I want there to be a 20px gap between them. can someone have a look at my code to see where I can do this. Thanks all!

       

      import mx.transitions.Tween;

      import mx.transitions.easing.*;

       

      this.createEmptyMovieClip("container",1);

      var imagesNumber:Number = 9;

      var scrolling:Boolean = true;

       

      for (i=1; i<=imagesNumber; i++) {

      container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);

      myThumb_mc = container["thumb"+i+"_mc"];

      myThumb_mc._x = (i-1)*myThumb_mc._width;

      myThumb_mc._y = (Stage.height-myThumb_mc._height)/2;

      myThumb_mc._alpha = 50;

      myThumb_mc.largerImage = i;

      myThumb_mc.onRollOver = function() {

      this._alpha = 100;

      };

      myThumb_mc.onRollOut = function() {

      this._alpha = 50;

      };

      myThumb_mc.onRelease = function() {

      this._alpha=50;

      for (i=1; i<=imagesNumber; i++) {

      var myClip = container["thumb"+i+"_mc"];

      myClip.enabled = false;

      }

      scrolling = false;

      _root.attachMovie("image"+this.largerImage,"large_mc",2);

      large_mc._x = (Stage.width-large_mc._width)/2;

      large_mc._y = (Stage.height-large_mc._height)/2;

      new Tween(large_mc, "_alpha", Strong.easeOut, 0, 100, 0.5, true);

      new Tween(container,"_alpha",Strong.easeOut,100,50,0.5,true);

      large_mc.onRelease = function() {

      scrolling = true;

      var myFadeOut = new Tween(large_mc, "_alpha", Strong.easeOut, 100, 0, 0.5, true);

      new Tween(container,"_alpha",Strong.easeOut,50,100,0.5,true);

      myFadeOut.onMotionFinished = function() {

      for (i=1; i<=imagesNumber; i++) {

      var myClip = container["thumb"+i+"_mc"];

      myClip.enabled = true;

      }

      large_mc.removeMovieClip();

      };

      };

      };

      }

       

      container.onEnterFrame = function() {

      if (scrolling){

      this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*15;

      if (this._x>0) {

      this._x = 0;

      }

      if (-this._x>(this._width-Stage.width)) {

      this._x = -(this._width-Stage.width);

      }

      }

      };

       

      Sorry I'm not sure how to add a block of code anymore, been a long time sense I was on here last