# Actionscript Easing Menu Question

**URL:** <https://forum.kirupa.com/t/actionscript-easing-menu-question/61101>\
**Category:** flash\
**Created:** [August 16, 2004, 1:40am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101 "2004-08-16T01:40:45Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirenetta1](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Sirenetta1](https://forum.kirupa.com/u/Sirenetta1)\
**Post date:** [August 16, 2004, 1:40am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/1 "2004-08-16T01:40:45Z")

</div>

Hello,

I know how to make a menu using tweening to ease open/close a menu, but I know there has to be a better way of doing this with actionscript.

What actionscript could I use to make a box rise to a certain Y value and decrease to a certain Y value on a button click?

Thanks for your 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:** [August 16, 2004, 4:16am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/2 "2004-08-16T04:16:57Z")

</div>

have you tried [searching for easing? i’ve made a sample fla available [URL=http://www.kirupaforum.com/forums/showthread.php?t=62491]here](http://www.kirupaforum.com/forums/search.php?searchid=98618)

---

<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 17, 2004, 3:38am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/3 "2004-08-17T03:38:56Z")

</div>

BW2, I’ve searched for easing, rising, drop-down, pop up, you name it! 🙂 I took a look at your .fla and it was very interesting! What I was wondering is if you could make the same effect by not having the box move to a certain location… meaning that the box grows when you click a button and shrinks when you click the button again. Can I modify your code to do the same thing?

---

<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 17, 2004, 4:07am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/4 "2004-08-17T04:07:16Z")

</div>

> [@Sirenetta1](#):
>
> What I was wondering is if you could make the same effect by not having the box move to a certain location… meaning that the box grows when you click a button and shrinks when you click the button again.

you can’t create the “same effect” because i have 4 mc’s that move around and resize. but you can resize the boxes still without moving them.

you’ll just have to setup if and elseif statements. so let’s say you setup a variable named power. this will tell us whether or not the button has been clicked on (=1) or off(=0).

so for the MC (with instance name mc) AS:[AS]onClipEvent(load){  
power=0; // off position to start  
speed=5; // speed of easing  
endW=50; // starting width  
endH=100; // starting height  
}  
onClipEvent(enterFrame){  
w = endW-this.\_width;  
this.\_width += w/speed;  
h = endH-this.\_height;  
this.\_height += h/speed;  
}[/AS]

and for the button AS:[AS]on(release){  
if(mc.power==0){ // if mc is “off”  
mc.endW=200;  
mc.endH=400;  
mc.power=1; // if it is pressed again, it will turn it “on”  
}  
else if(mc.power==1){ // if mc is “on”  
mc.endW=50;  
mc.endH=100;  
mc.power=0; // if it is pressed again, it will turn it “off”  
}  
}[/AS]

**// edit: sorry, i was thinking this was another post so if some of what i said in the paragraph doesn’t seem to make sense don’t worry about it. in short, you can’t create the “same” effect. but you could just make the box grow to the size that would equal the distance of the additional button.**

the AS here still shows you how to resize a box though

---

<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 17, 2004, 7:13am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/5 "2004-08-17T07:13:58Z")

</div>

Have a look here too;)  
[http://www.kirupaforum.com/forums/showthread.php?t=65908](http://www.kirupaforum.com/forums/showthread.php?t=65908)

scotty(-:

---

<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 18, 2004, 12:55am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/6 "2004-08-18T00:55:15Z")

</div>

BWH2, THANKS SO MUCH!! This was EXACTLY what I was looking for! I’ll post the .fla for others to learn. Thanks!

---

<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 18, 2004, 2:29am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/7 "2004-08-18T02:29:51Z")

</div>

you’re welcome.

---

<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 18, 2004, 3:29am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/8 "2004-08-18T03:29:43Z")

</div>

BWH2, maybe you can help me again… I’m trying to get some text to rise up in the menu as it’s rising (so that the menu and text rise at the same speed). Been working on this for a couple of hours, but I can’t seem to get the text to be in sync with the menu. I’ve tried putting the text as a movie with a mask/tween, but it just doesn’t work right. Now I’m thinking that somehow I can tie this in to the actionscript I already have on the buttons… what do you advise?

---

<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 18, 2004, 4:41am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/9 "2004-08-18T04:41:34Z")

</div>

i would advise using \_y instead of \_height. that way, you can have the box and text be the same mc. then you could just move it up and down accordingly (rather than adjusting the height). it will give the same effect, but will add text to it.

to complete it, just mask the area you want showing on the main timeline. that way, when the mc moves down on the y axis, it will only show the part you want.

---

<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 19, 2004, 1:49am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/10 "2004-08-19T01:49:54Z")

</div>

BWH2, THANKS AGAIN! This worked perfectly!! Again I’ll attach the updated .fla for others to learn!

---

<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 19, 2004, 3:16am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/11 "2004-08-19T03:16:35Z")

</div>

no problem.

---

<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 20, 2004, 3:56am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/12 "2004-08-20T03:56:54Z")

</div>

Well, I thought my questions were over, but I have one more. Why is it that when I put everything into a movie clip, that nothing works anymore? I was thinking about putting everything in a movie clip to save space on my opening frames of the website, but now I don’t think this is possible? Does it have something to do with the onclipevent? Or does putting it into a movie clip complicate the power mc? What am I doing wrong? I’ll attach the .fla!!

---

<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 21, 2004, 2:01am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/13 "2004-08-21T02:01:00Z")

</div>

Nevermind… the h values were just off. If you want the menu in a movie clip, see the attachment!

---

<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 21, 2004, 8:24am UTC](https://forum.kirupa.com/t/actionscript-easing-menu-question/61101/14 "2004-08-21T08:24:04Z")

</div>

how to make the menu open and close in a smooth and fast motion?
