# Button Effect

**URL:** <https://forum.kirupa.com/t/button-effect/14780>\
**Category:** Uncategorized\
**Created:** [March 2, 2003, 7:28pm UTC](https://forum.kirupa.com/t/button-effect/14780 "2003-03-02T19:28:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxtr0sity](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Maxtr0sity](https://forum.kirupa.com/u/Maxtr0sity)\
**Post date:** [March 2, 2003, 7:28pm UTC](https://forum.kirupa.com/t/button-effect/14780/1 "2003-03-02T19:28:25Z")

</div>

I spent 20min trying to create some cool effects for my site’s new design, the current button is just fading effects…anyone know of any good ones? or ideas?

max  
ps.doe anyone know how to do some of the stuff that [http://www.firestormpc.com](http://www.firestormpc.com) has?

---

<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:** [March 2, 2003, 9:14pm UTC](https://forum.kirupa.com/t/button-effect/14780/2 "2003-03-02T21:14:10Z")

</div>

The buttons on that site you posted are made with tweens and some nice graphics. It’s nothing to complicated so I put together a really simple example for you to take a look, hopefully it will give you some ideas.

The important thing is to know how it actually works, in the example I made for you, I’m using hittest to create the rollOver effect.

If you have any questions then just ask. =)

---

<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:** [March 2, 2003, 10:35pm UTC](https://forum.kirupa.com/t/button-effect/14780/3 "2003-03-02T22:35:32Z")

</div>

very nice…never seen someone do AS with buttons…but i’m truly amazed…but i don’t understand the AS, but willing 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:** [March 2, 2003, 11:02pm UTC](https://forum.kirupa.com/t/button-effect/14780/4 "2003-03-02T23:02:01Z")

</div>

if you don’t understand the code check the **actionscript dictionary** 😉

everything is there 🙂

---

<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:** [March 2, 2003, 11:04pm UTC](https://forum.kirupa.com/t/button-effect/14780/5 "2003-03-02T23:04:39Z")

</div>

yea…i was gonna do that…

ps. electrongeek…u seriously have an AMAZING site…that is the most beautiful thing i’ve ever seen…:A+:

---

<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:** [March 2, 2003, 11:07pm UTC](https://forum.kirupa.com/t/button-effect/14780/6 "2003-03-02T23:07:36Z")

</div>

Hey thanks Maxtr0sity, glad you like it. =)

---

<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:** [March 3, 2003, 9:05am UTC](https://forum.kirupa.com/t/button-effect/14780/7 "2003-03-03T09:05:56Z")

</div>

Wow! Is EG using movie clips for buttons?! I taught you well my son :\*(

And … TOLD YA SO!!! (about your site… you know what I am talking about)

---

<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:** [March 3, 2003, 12:18pm UTC](https://forum.kirupa.com/t/button-effect/14780/8 "2003-03-03T12:18:48Z")

</div>

Very intresting, I have never seen a button done this way with actionscript. I dont understand why the MC does not just loop, because I did not see any “Stop” commands?

And how exactley does the “nextFrame” and “prevFrame” commands actually work? Do they just play the clip once to the end stopping at the last frame? If anyone is willing to shed some light on the matter it would be appreciated.

Cheers.

---

<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:** [March 3, 2003, 5:54pm UTC](https://forum.kirupa.com/t/button-effect/14780/9 "2003-03-03T17:54:12Z")

</div>

nextFrame() does as it says, it moves to the next frame 🙂 Of course when it reaches the end of the animation there are no more next frames, so it stays at the end. Then when the hitTest is false it plays prevFrame() which is the previous frame. And once the animation is back to frame 1 there are no more previous frames so it stays there 🙂

In Flash MX you can also use on handlers on movie clips that could previously only be used on buttons.

Things like on (press), on (release), on(rollOver), on (rollOut), etc, etc.

---

<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:** [March 3, 2003, 8:01pm UTC](https://forum.kirupa.com/t/button-effect/14780/10 "2003-03-03T20:01:59Z")

</div>

well…i tried to modify it…didn’t come out good…how would i do that effect in a button?..because i hav no idea how to do the “down” action in a movieclip…

---

<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:** [March 3, 2003, 10:56pm UTC](https://forum.kirupa.com/t/button-effect/14780/11 "2003-03-03T22:56:05Z")

</div>

The example file I posted is made with a movieclip so model it after the file I posted and you shouldn’t have a problem.

Double click on the movieclip and you’ll see how it was set up inside as well.

---

<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:** [March 3, 2003, 11:21pm UTC](https://forum.kirupa.com/t/button-effect/14780/12 "2003-03-03T23:21:50Z")

</div>

i saw that, but since i’m not experienced in AS, i don’t know how to use the code to do a button animation…:-\

---

<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:** [March 3, 2003, 11:31pm UTC](https://forum.kirupa.com/t/button-effect/14780/13 "2003-03-03T23:31:12Z")

</div>

Well what exactly are you trying to do? Describe what kind of button animation you want to do and I’ll see if I can help you with it.

There are more than one way to do things so I could probably show you an easier way.

---

<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:** [March 3, 2003, 11:36pm UTC](https://forum.kirupa.com/t/button-effect/14780/14 "2003-03-03T23:36:39Z")

</div>

well…take a look at this button…i know it is extremely sad…and i can do a lot better…i just wanted some fade effects or other cool effects to happen…the colors will be changed…but its embarrasing…

[http://www.asianillusion.com/projects/Button/Button.swf](http://www.asianillusion.com/projects/Button/Button.swf)  
[http://www.asianillusion.com/projects/Button/ButtonFLA.fla](http://www.asianillusion.com/projects/Button/ButtonFLA.fla)

sad…☹

---

<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:** [March 3, 2003, 11:39pm UTC](https://forum.kirupa.com/t/button-effect/14780/15 "2003-03-03T23:39:33Z")

</div>

Ok I get an error with both of those links. Go ahead and attach the file along with your post and I’ll take a look at it.

---

<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:** [March 3, 2003, 11:42pm UTC](https://forum.kirupa.com/t/button-effect/14780/16 "2003-03-03T23:42:09Z")

</div>

while u were posting…i fixed it…sry

---

<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:** [March 3, 2003, 11:52pm UTC](https://forum.kirupa.com/t/button-effect/14780/17 "2003-03-03T23:52:16Z")

</div>

Here you go, I took your button file and added a lil bit more to it to make it a bit more interesting.

I used the same hitTest method as the first button I posted, please model your button after my sample, it’s much more easier than how you set up yours.

Hopefully this will give you more ideas. =)

---

<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:** [March 4, 2003, 12:03am UTC](https://forum.kirupa.com/t/button-effect/14780/18 "2003-03-04T00:03:16Z")

</div>

UR AN ABSOLUTE GENIUS!..i would love to use that kind of effect…now…wat if i wanted a “Down” command that comes up like if I was to do it in a button?

---

<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:** [March 4, 2003, 12:15am UTC](https://forum.kirupa.com/t/button-effect/14780/19 "2003-03-04T00:15:37Z")

</div>

Like I said before, there are more than one way to do things in flash and here I’m showing you the easiest way.

To create the down state, I added this tid bit of code to the existing AS so far:

```php
onClipEvent (mouseDown) {
		this._alpha = 50
}
onClipEvent (mouseUp) {
		this._alpha = 100
}

```

What it basically does it reduce the alpha (opacity) of the movieclip to 50 when the mouse button is down and when you let go of the mouse button, it goes back up changing the alpha back to 100.

Take a look at the new sample. =)

---

<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:** [March 4, 2003, 12:19am UTC](https://forum.kirupa.com/t/button-effect/14780/20 "2003-03-04T00:19:17Z")

</div>

wow…i’m amused…ummm…so basically…the \_alpha thingy can be changed to almost every command rit?..lik…\_brightness?

[Next page](https://forum.kirupa.com/t/button-effect/14780.md?page=2)
