1 Reply Latest reply on Feb 15, 2007 7:26 AM by dalewb

    resize height of emptyMovieClip?

    luciewong
      Hi,
      I would like to resize with an handler the height of my backgroundZ3 only. I can resize the width, but not the height.
      I have tried many things, but at the end the yposition of the blue background always moves with the resize.
      Could someone please help?
      Here is my code>

      var cdepth:Number = 0;
      //BACKGROUNDS
      var LineColorA:Number = 0x000000;
      var BGColorA:Number = 0x99FF00;
      var LineColorB:Number = 0x000000;
      var BGColorB:Number = 0xCCFF00;
      var LineColorC:Number = 0x000000;
      var BGColorC:Number = 0x3399FF;
      //xxx
      //''the backgrounds Z> var ZMtA:Number = 0;//ZMtA; var ZMtB:Number = 0;//ZMtB; var ZLt1A:Number = 200;//ZLt1A; var ZLt1B:Number = 0;//ZLt1B; var ZLt2A:Number = 200;//ZLt2A; var ZLt2B:Number = 38;//ZLt2B; var ZLt3A:Number = 0;//ZLt3A; var ZLt3B:Number = 38;//ZLt3B; var ZEfA:Number = 0;//ZEfA; var ZEfB:Number = 0;//ZEfB; var ZX:Number = 0;//ZX; var ZY:Number = 0;//ZY;


      //''the backgrounds Z2> var Z2MtA:Number = 0;//Z2MtA; var Z2MtB:Number = 39;//Z2MtB; var Z2Lt1A:Number = 200;//Z2Lt1A; var Z2Lt1B:Number = 39;//Z2Lt1B; var Z2Lt2A:Number = 200;//Z2Lt2A; var Z2Lt2B:Number = 78;//Z2Lt2B; var Z2Lt3A:Number = 0;//Z2Lt3A; var Z2Lt3B:Number = 78;//Z2Lt3B; var Z2EfA:Number = 0;//Z2EfA; var Z2EfB:Number = 39;//Z2EfB; var Z2X:Number = 0;//Z2X; var Z2Y:Number = 0;//Z2Y;
      //''the backgrounds Z3> var Z3MtA:Number = 0;//Z3MtA; var Z3MtB:Number = 79;//Z3MtB; var Z3Lt1A:Number = 200;//Z3Lt1A; var Z3Lt1B:Number = 79;//Z3Lt1B; var Z3Lt2A:Number = 200;//Z3Lt2A; var Z3Lt2B:Number = 200;//Z3Lt2B; var Z3Lt3A:Number = 0;//Z3Lt3A; var Z3Lt3B:Number = 200;//Z3Lt3B; var Z3EfA:Number = 0;//Z3EfA; var Z3EfB:Number = 79;//Z3EfB; var Z3X:Number = 0;//Z3X; var Z3Y:Number = 0;//Z3Y;
      //xxxxxxxxxxxxx
      var myWidth:Number = 200;
      var myHeight:Number = 200;
      //..holder_mc>
      var hoX:Number = 0.0;
      var hoY:Number = 0.0;
      //holder
      this.createEmptyMovieClip("holder_mc",cdepth+38);//
      //xxRIGHT DRAG>
      this.holder_mc.createEmptyMovieClip("rightDrag", cdepth+41);//483);
      this.holder_mc["rightDrag"].lineStyle(1, 0xFF6600, 100);//LineColor
      this.holder_mc["rightDrag"].beginFill(0x00FFFF, 100);//BGColor
      this.holder_mc["rightDrag"].moveTo(hoX, 0);//(100, -8);//-25,-10
      this.holder_mc["rightDrag"].lineTo(hoX+4, 0);//160//25,-10
      this.holder_mc["rightDrag"].lineTo(hoX+4, 8);//100//160//320);//25, 10
      this.holder_mc["rightDrag"].lineTo(hoX, 8);//100//320);//-25,10
      this.holder_mc["rightDrag"].endFill(hoX, 0);//-25,-10
      this.holder_mc["rightDrag"]._x= myWidth;// - 2;//590.0;//135.0;
      this.holder_mc["rightDrag"]._y= myHeight/2;//-2;//105.0;//219.0;
      //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      this.holder_mc.createEmptyMovieClip("downDrag", cdepth+60);//swapp depth with min_btn<31/3/06>42);//485);
      this.holder_mc["downDrag"].lineStyle(1, 0xFF6600, 100);//LineColor
      this.holder_mc["downDrag"].beginFill(0x00FFFF, 100);//BGColor
      this.holder_mc["downDrag"].moveTo(hoX, 0);//(100, -8);//-25,-10
      this.holder_mc["downDrag"].lineTo(hoX+8, 0);//160//25,-10
      this.holder_mc["downDrag"].lineTo(hoX+8, 4);//100//160//320);//25, 10
      this.holder_mc["downDrag"].lineTo(hoX, 4);//100//320);//-25,10
      this.holder_mc["downDrag"].endFill(hoX, 0);//-25,-10
      this.holder_mc["downDrag"]._x= myWidth/2;//hoX+(myWidth/2);// -4;//590.0;//135.0;
      this.holder_mc["downDrag"]._y= myHeight;//hoY+(myHeight+2);// -4;//105.0;//219.0;
      //xxx
      //we create the backgroundxxxx
      this.createEmptyMovieClip("backgroundZ", cdepth-900);
      this["backgroundZ"].lineStyle(1, LineColorA, 100);//LineColor
      this["backgroundZ"].beginFill(BGColorA, 100);//BGColor
      this["backgroundZ"].moveTo(ZMtA, ZMtB);//
      this["backgroundZ"].lineTo(ZLt1A, ZLt1B);//(618, -8);//25,-10
      this["backgroundZ"].lineTo(ZLt2A, ZLt2B);//(618, 60);//320);//25, 10
      this["backgroundZ"].lineTo(ZLt3A, ZLt3B);//(25, 60);//320);//-25,10
      this["backgroundZ"].endFill(ZEfA, ZEfB);//(25, -8);//-25,-10
      this["backgroundZ"]._x = ZX;//135.0;
      this["backgroundZ"]._y = ZY;//37.0;//Temp217.0;
      //we create the backgroundxxxx
      this.createEmptyMovieClip("backgroundZ2", cdepth-901);
      this["backgroundZ2"].lineStyle(1, LineColorB, 100);//LineColor
      this["backgroundZ2"].beginFill(BGColorB, 100);//BGColor
      this["backgroundZ2"].moveTo(Z2MtA, Z2MtB);//(25, -8);//-25,-10
      this["backgroundZ2"].lineTo(Z2Lt1A, Z2Lt1B);//(195, -8);//25,-10
      this["backgroundZ2"].lineTo(Z2Lt2A, Z2Lt2B);//(195, 256);//60);//320);//25, 10
      this["backgroundZ2"].lineTo(Z2Lt3A, Z2Lt3B);//(25, 256);//60);//320);//-25,10
      this["backgroundZ2"].endFill(Z2EfA, Z2EfB);//(25, -8);//-25,-10
      this["backgroundZ2"]._x= Z2X;//135.0;
      this["backgroundZ2"]._y= Z2Y;//102;//37.0;//Temp217.0;
      //xxxx
      //we create the backgroundxx
      this.createEmptyMovieClip("backgroundZ3", cdepth-902);
      this["backgroundZ3"].lineStyle(1, LineColorC, 100);//LineColor
      this["backgroundZ3"].beginFill(BGColorC, 100);//BGColor
      this["backgroundZ3"].moveTo(Z3MtA, Z3MtB);//(25, -8);//-25,-10
      this["backgroundZ3"].lineTo(Z3Lt1A, Z3Lt1B);//(447, -8);//25,-10//620
      this["backgroundZ3"].lineTo(Z3Lt2A, Z3Lt2B);//(447, 256);//60);//320);//25, 10//620
      this["backgroundZ3"].lineTo(Z3Lt3A, Z3Lt3B);//(25, 256);//60);//320);//-25,10
      this["backgroundZ3"].endFill(Z3EfA, Z3EfB);//(25, -8);//-25,-10
      this["backgroundZ3"]._x= Z3X;//306.5;//200;//135.0;
      this["backgroundZ3"]._y= Z3Y;//102;//37.0;//Temp217.0;
      //xxxx
      //xxxxxxxxxxend of createBackground
      //xxRIGHT DRAG>
      this.holder_mc.rightDrag.onPress = function() {
      //xxxxx
      PicIntervallD = 100;
      setInterval(this,PicIntervallD);
      //xxx
      var MouseListenerPic:Object = new Object();
      //xxx
      MouseListenerPic.onMouseMove = function(){
      //xxx
      myWidth = _xmouse;//
      //xxx
      setProperty(holder_mc.rightDrag, _x, myWidth); //ok
      setProperty(holder_mc.downDrag, _x, myWidth/2);//
      //xxx
      setProperty(backgroundZ, _width, myWidth); //ok
      setProperty(backgroundZ2, _width, myWidth); //ok
      setProperty(backgroundZ3, _width, myWidth); //ok
      //xxx***
      updateAfterEvent();
      //xxx
      }
      //xxxxxxxxxxxxxxxend of MOVExxxxxxxxxxxxxxxxxxx
      MouseListenerPic.onMouseUp = function(){
      //xxx
      Mouse.removeListener(this);
      }
      //xxxend of mouse UPxx
      Mouse.addListener(MouseListenerPic);
      //x********************************************
      };
      //xxxxxxxend of PRESSxxxxx
      this.holder_mc.rightDrag.onRelease = function() {
      //xxxx
      Mouse.removeListener(MouseListenerPic);
      //xxx
      clearInterval(PicIntervallD);
      //xx
      };
      //end of Release right Drag<<
      //xxxxxxend of rightDragxxxxxxxxx

      //xxDOWN DRAG>
      this.holder_mc.downDrag.onPress = function() {
      //xxxxx
      PicIntervallD2 = 100;
      setInterval(this,PicIntervallD2);
      //xxx
      var MouseListenerPic2:Object = new Object();
      //xxx
      MouseListenerPic2.onMouseMove = function(){
      //xxx
      myHeight = _ymouse;//
      //xxx
      setProperty(holder_mc.downDrag, _y, myHeight);
      setProperty(holder_mc.rightDrag, _y, myHeight/2);//
      //xxx
      //setProperty(backgroundZ, _height, myHeight-(Z2Lt2B+Z3Lt2B));
      //setProperty(backgroundZ2, _height, myHeight-Z3Lt2B);
      //setProperty(backgroundZ3, _y, ZMtB); //ok
      //setProperty(backgroundZ3, _height, _ymouse-(Z2Lt2B+Z3Lt2B)); //ok
      //setProperty(backgroundZ3, _height, _ymouse-(Z2Lt1B+ZLt1B));//-(Z2Lt2B+Z3Lt2B)); //
      //xxx***
      updateAfterEvent();
      //xxx
      }
      //xxxxxxxxend of MOVExxx
      MouseListenerPic2.onMouseUp = function(){
      //xxx
      Mouse.removeListener(this);
      }
      //xxxend of mouse UPxx
      Mouse.addListener(MouseListenerPic2);
      //x*****
      };
      //xxxxxxxxxxend of PRESSxxx
      this.holder_mc.downDrag.onRelease = function() {
      //xxx
      Mouse.removeListener(MouseListenerPic2);
      clearInterval(PicIntervallD2);
      };
      //end of Release down Drag<<
      //xxxxxxxxend of downDragxx







        • 1. Re: resize height of emptyMovieClip?
          dalewb
          I doubt you're going to get anyone to scour through that mountain of code for you, buddy. You might want to trim the code you post here significantly. It is safe to assume that 98% of those who bother to view your post are going to take one look at it and go "Oh my gosh that is nuts" and just move on. Try to narrow down where you suspect the problem lies and post just that... Remember, the bulk of the responsibility to figure this out is on you, not someone here. I tried looking through your code, but I honestly could not make sense of it... my actionscript skills must be less mature than yours; but my first through was backgroundZ3.height or backgroundZ3 .yscale... Good luck.