# MC width and height grow

**URL:** <https://forum.kirupa.com/t/mc-width-and-height-grow/27022>\
**Category:** flash\
**Created:** [July 29, 2003, 3:01pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022 "2003-07-29T15:01:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![DigitalPimp](https://avatars.discourse-cdn.com/v4/letter/d/5f8ce5/32.png) [@DigitalPimp](https://forum.kirupa.com/u/DigitalPimp)\
**Post date:** [July 29, 2003, 3:01pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/1 "2003-07-29T15:01:24Z")

</div>

I’m certain that a thread has been started on this before but I can’t find it. I want to have a MC grow when another MC is clicked on and then also be able to shrink back up with click on again. Can somebody please help me?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 3:04pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/2 "2003-07-29T15:04:23Z")

</div>

nevermind. I just found some old code I had written. HEHE I’m a tard.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 3:13pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/3 "2003-07-29T15:13:37Z")

</div>

Oh k now,

I’m using this code

```auto

onClipEvent (load) {
	speed = 2;
	returnSpeed = 1;
}
onClipEvent (enterFrame) {
	this._yscale += (scaleY-_yscale)/speed;
	if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
		scaleX = 220;
		scaleY = 220;
		checkVar = "on";
 	}
   else {
		checkVar = "off"; 
 	}
	if (checkVar == "off") {
		scaleX = 100;
		scaleY = 100;
	}
	
}
[/AS]

And it does make the box grow but what I'm looking for more like something on http://www.kurtnoble.com/. Can somebody please help meh? :p:
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 3:33pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/4 "2003-07-29T15:33:08Z")

</div>

i think it should be hitTest(\_root.\_xmouse,\_root.\_ymouse,false)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 3:35pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/5 "2003-07-29T15:35:03Z")

</div>

That makes no difference. It is a lot bigger change to the AS than that.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 4:44pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/6 "2003-07-29T16:44:25Z")

</div>

[AS]distance = 20;  
total = 4;  
for (i=0; i\<total; i++) {  
var clip = this.createEmptyMovieClip(“clip”+i, i);  
clip.beginFill(0x000000, 60);  
clip.lineTo(40, 0);  
clip.lineTo(40, 40);  
clip.lineTo(0, 40);  
clip.lineTo(0, 0);  
clip.endFill();  
clip.clip = this[“clip”+(i-1)];  
clip.scale = 100;  
clip.onEnterFrame = function() {  
var x = this.clip.\_x+this.clip.\_width+distance;  
this.x = this.x\*.4+(x-this.\_x)_.2;  
this.\_x += this.x;  
this.s = this.s_.8+(this.scale-this.\_xscale)\*.4;  
this.\_xscale = this.\_yscale += this.s;  
};  
clip.onRelease = function() {  
if (this.scale == 200) {  
this.scale = 100;  
} else {  
for (i=0; i\<total; i++) {  
var clip = this.\_parent[“clip”+i];  
clip.scale = clip == this ? 200 : 100;  
}  
}  
};  
}[/AS]  
… You’ll get the idea. 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 4:52pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/7 "2003-07-29T16:52:49Z")

</div>

That is awesome, just what I needed.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 5:00pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/8 "2003-07-29T17:00:48Z")

</div>

Glad I could help. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 8:33pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/9 "2003-07-29T20:33:24Z")

</div>

Oh k,  
I’ve toyed with that scrip Kax gave me and well now I want to change a couple of things back can’t see to get them.

How do I invert this menu vertically? I want these shapes to be flipped and have them spring up instead of down. Also, How do I position them wherever I want on the x-axis?

Here is the script:  
[AS]  
distance = -1;  
total = 4;  
for (i=0; i\<total; i++) {  
var clip = this.createEmptyMovieClip(“clip”+i, i);  
clip.lineStyle(.5, 0x000000, 100);  
clip.beginFill(0xC8C8C8, 80);  
clip.lineTo(40, 0);  
clip.lineTo(40, 20);  
clip.lineTo(0, 50);  
clip.lineTo(0, 0);  
clip.endFill();  
clip.clip = this[“clip”+(i-1)];  
clip.scale = 100;  
clip.onEnterFrame = function() {  
var x = this.clip.\_x+this.clip.\_width+distance;  
this.x = this.x\*.2+(x-this.\_x)_.4;  
this.\_x += this.x;  
this.\_y = 50;  
this.yS = this.yS_.7+(this.scale-this.\_xscale)_.1;  
this.xS = this.xS_.7+(this.scale-this.\_yscale)_.1;  
this.\_xscale += this.xS;  
this.\_yscale += this.yS;  
};  
var subClip = clip.createEmptyMovieClip(“subClip”+i, i+total);  
subClip.lineStyle(.5, 0xFFFFFF, 100);  
subClip.beginFill(0xC8C8C8, 100);  
subClip.lineTo(34, 0);  
subClip.lineTo(34, 45);  
subClip.lineTo(0, 45);  
subClip.lineTo(0, 0);  
subClip.endFill();  
subClip.subClip = this[“subClip”+(i-1)];  
subClip.scale = 100;  
subClip.onEnterFrame = function() {  
var x = this.subClip.\_x+this.subClip.\_width+3;  
this.\_y = this.subClip.\_y+this.subClip.\_height+3;  
this.x = this.x_.4+(x-this.\_x)\*.2;  
this.\_x += this.x;  
};  
clip.onRelease = function() {  
if (this.scale == 200) {  
this.scale = 100;  
} else {  
for (i=0; i\<total; i++) {  
var clip = this.\_parent[“clip”+i];  
clip.scale = clip == this ? 400 : 100;  
}  
for (i=0; i\<total; i++) {  
var subClip = this.\_parent[“subClip”+i];  
subClip.scale = subClip == this ? 400 : 100;  
}  
}  
};  
}

```auto

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 11:27pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/10 "2003-07-29T23:27:37Z")

</div>

need help…plz…running out of…air…for…brain…

BEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPPPPPPP

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2003, 1:04am UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/11 "2003-08-04T01:04:41Z")

</div>

hey this is kyle (kernlearn). take a look at the attchment and see if it’s what you need. the way i did it, you don’t have to modify the script in any way. just create a MC with nothing in it, then paste the script into the first frame(which should be blank). now on the parent timeline there is a registration point. by moving the registration point, you can freely move the boxes wherever you want. you can also flip and rotate the registration point to get the orientation you want.

hope this is what you need.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2003, 2:20pm UTC](https://forum.kirupa.com/t/mc-width-and-height-grow/27022/12 "2003-08-04T14:20:34Z")

</div>

Oh, I see what you did! Thanks a lot Kyle. That was exactly what I needed.
