# Help needed: setting up buttons from coded MovieClips

**URL:** <https://forum.kirupa.com/t/help-needed-setting-up-buttons-from-coded-movieclips/245790>\
**Category:** Uncategorized\
**Created:** [December 4, 2007, 3:30am UTC](https://forum.kirupa.com/t/help-needed-setting-up-buttons-from-coded-movieclips/245790 "2007-12-04T03:30:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddd\_estudio](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@ddd\_estudio](https://forum.kirupa.com/u/ddd_estudio)\
**Post date:** [December 4, 2007, 3:30am UTC](https://forum.kirupa.com/t/help-needed-setting-up-buttons-from-coded-movieclips/245790/1 "2007-12-04T03:30:27Z")

</div>

hi community, time for some interaction here - help needed this time

in order to gain control over buttons in a portfolio showcase in AS3, i found it interesting to set up buttons manually using code to extend MovieClips, but a bug seems to threaten the efficiency of these extended MCs:

**PROBLEM** [LIST]  
[\*]buttons fail to stick to the “up” state when there’s a MouseEvent.CLICK targetting them; event listener of the type “MouseEvent.MOUSE\_OVER” is apparently “always on top” and prevents the “CLICK” one to act accordingly[/LIST]is it a way to solve this problem setting up a boolean variable that would be set to true if the according btn is clicked? i tried to solve it this way but can’t really understand what is happening when the function is called. it was very useful to set up _trace_ commands all over the code so i can debut exactly what functions are being triggered, but even though these outputs are helpful i still can’t understand the script workflow.

**YES, I SAID WORKFLOW**  
perhaps the first thing to ask here is: what would be a standard-compliant way to code this functionality to MCs in AS3?

as i am creating a structure for buttons inside the portfolio session of the site, repeted several times, should i consider creating a package (custom class?) for them?

ideally, these buttons would be load to the secondary-navigation bar like in [tpspoons’ [URL=“http://www.kirupa.com/forum/showthread.php?t=272301”]**[as3]Image gallery**](http://www.kirupa.com/forum/member.php?u=32560), with a different styling but basically with the same scripting. also ideally, MOUSE\_OVER would be a different effect and when CLICKed it would preserve the “up” status.

\*\*ANY SUGGESTIONS ?  
\*\*your attention is very much appreciated: thanks!  
ddd\_estudio
