# Flash 8, AS2, Help with mc button

**URL:** <https://forum.kirupa.com/t/flash-8-as2-help-with-mc-button/316245>\
**Category:** flash\
**Created:** [November 16, 2010, 8:57pm UTC](https://forum.kirupa.com/t/flash-8-as2-help-with-mc-button/316245 "2010-11-16T20:57:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zipper](https://avatars.discourse-cdn.com/v4/letter/z/5f8ce5/32.png) [@zipper](https://forum.kirupa.com/u/zipper)\
**Post date:** [November 16, 2010, 8:57pm UTC](https://forum.kirupa.com/t/flash-8-as2-help-with-mc-button/316245/1 "2010-11-16T20:57:22Z")

</div>

Hi there. First off I just want to say that I do NOT understand ActionScript, I am learning as i go. Also, my situation is not new, and I have seen threads simular to mine, but to be honest I don’t understand them.  
Ok, I have created a animated MC Button and I uesed the Behaviors to control the OnRollOver, OnRollOut and OnRelease states  
of the button. I also used an invisible button for better control of the MC button. I am also using screens,(Please note, if there  
is a better or easier way to acheive the resulte I’m looking for or just using a different methade just let me know)  
Here is what I would like the button to do. When the user clicks on it I would like the button to stay in the Down state, to repesent  
that the user is on that page. Right now it only works if I click and drag away from the button, then it will stay on the Down state.  
I also want it to go to a certen page or in my case, I’m using screens so I’d like it to go to a certen screen on Release.  
I am really struggling with this. I have attached my .fla file of just the button. You can see a preview of this at [Swfupload.com](http://Swfupload.com) here:  
[http://www.swfupload.com/view/119043.htm](http://www.swfupload.com/view/119043.htm)

Here is my code:

```auto

on (rollOver) {
 //Movieclip GotoAndPlay Behavior
 this.home_btn.gotoAndPlay("over");
 //End Behavior
}
on (rollOut) {
 //Movieclip GotoAndPlay Behavior
 this.home_btn.gotoAndPlay("out");
 //End Behavior
}
on (release) {
 // GoTo Screen behavior
      if((this.home != undefined) && (this.home != null))
      {
        var screen = null;
        var target = this;
        while((screen == null) && (target != undefined) && (target != null))
        {
          if(target instanceof mx.screens.Screen)
          {
            screen = target;
          }
          else
          {
            target = target._parent;
          }
        }
        if(screen instanceof mx.screens.Slide)
        {
          screen.gotoSlide(this.home);
        }
      }
 // End GoTo Screen behavior
 
}

```

If more information is needed please let me know.  
Thanks in advance,  
zipper
