# Button variables problem

**URL:** https://forum.kirupa.com/t/button-variables-problem/243584
**Category:** Uncategorized
**Created:** [November 8, 2007, 4:00pm UTC](https://forum.kirupa.com/t/button-variables-problem/243584 "2007-11-08T16:00:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JulyChurches](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@JulyChurches](https://forum.kirupa.com/u/JulyChurches)
#### Post date: [November 8, 2007, 4:00pm UTC](https://forum.kirupa.com/t/button-variables-problem/243584/1 "2007-11-08T16:00:00Z")

</div>

hi guys,

Im trying to get my head around actionscripting…and this is what i have so far…but its not working as i want.

what im trying to do is make the button frame go to frm2 when its clicked and in so doing, it makes the \_root goto the respective label. how can i tell the other buttons (mcs) to stay at frame 1 when one of the other buttons are clicked?

var is new for me…am i setting it right?

code inside button container mc:

```auto

//
var C=0;
//
tbtn1.onRelease = btn1.onReleaseOutside=function(){
    //
    _root.gotoAndPlay("label");
    //
    if ( C=1)
        {
            btn1.gotoAndStop(2);
            delete btn1.onRelease;
            btn1.useHandCursor = false;
        } 
    else if (C=0)
        {
            btn1.gotoAndStop(1);
        }
};

```

EDIT:  
also, how can i add a rollover functionality that does not break the other commands on the buttons (ie: stop at frm2)

thanks
