# Button scripting question

**URL:** <https://forum.kirupa.com/t/button-scripting-question/23356>\
**Category:** Uncategorized\
**Created:** [June 16, 2003, 8:56pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356 "2003-06-16T20:56:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NitroLiq](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@NitroLiq](https://forum.kirupa.com/u/NitroLiq)\
**Post date:** [June 16, 2003, 8:56pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356/1 "2003-06-16T20:56:54Z")

</div>

Hoping someone can point me in the right direction with this. Instead of creating a button and nesting movie clips for each state, I’m trying to script an animated button of a square (no fill) where on rollover the stroke color changes from one color to another (tweening the tint). I want to do this to the button symbol so it’s the same for all instances. Is this possible or do I have to go the button \> nested MC route?

Sorry if this is lame…it’s been awhile since I’ve used Flash and I’ve forgotten quite a bit.

Pete

---

<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:** [June 16, 2003, 9:07pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356/2 "2003-06-16T21:07:09Z")

</div>

Try this…

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=10598](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=10598)

---

<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:** [June 16, 2003, 9:28pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356/3 "2003-06-16T21:28:52Z")

</div>

Ok, i had actually figured out that bit of code:

```auto
on (rollOver) {
this.gotoAndPlay(frame);
}
on (rollOut) {
this.gotoAndPlay(frame);
}

```

I just thought there would be a way to, say instead of playing frame/label animations for each state, I could somehow script the tint change.

---

<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:** [June 16, 2003, 9:30pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356/4 "2003-06-16T21:30:48Z")

</div>

You COULD script the tint change, but I think it would be more CPU usage efficient if you did it with a tween in this case.

---

<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:** [June 16, 2003, 9:31pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356/5 "2003-06-16T21:31:19Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25999](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25999)

---

<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:** [June 16, 2003, 9:32pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356/6 "2003-06-16T21:32:00Z")

</div>

LOL kax, I was just about to post this link…

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22838](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22838)

But you posted a link to a thread where I posted that link before.

Wow… how confusing 😛

Well anyway, check either link if you still want to script 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:** [June 16, 2003, 9:34pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356/7 "2003-06-16T21:34:54Z")

</div>

😛

yeah… i was going to edit it, but you already posted it. :thumb:

---

<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:** [June 16, 2003, 9:48pm UTC](https://forum.kirupa.com/t/button-scripting-question/23356/8 "2003-06-16T21:48:03Z")

</div>

Yeah, I think I’ll make it easier on myself on just do the tween method. Thanks for the help guys.
