# Problem with instance names given in the editor

**URL:** <https://forum.kirupa.com/t/problem-with-instance-names-given-in-the-editor/287133>\
**Category:** flash\
**Created:** [April 27, 2009, 1:25am UTC](https://forum.kirupa.com/t/problem-with-instance-names-given-in-the-editor/287133 "2009-04-27T01:25:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![almo](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@almo](https://forum.kirupa.com/u/almo)\
**Post date:** [April 27, 2009, 1:25am UTC](https://forum.kirupa.com/t/problem-with-instance-names-given-in-the-editor/287133/1 "2009-04-27T01:25:10Z")

</div>

Hi!

I have two buttons, they’re both movie clips, and have identical code except for their names. When I place one of each on the stage and give them instance names, they come up output:

mi\_defaultButton  
instance294

Even though the BackButton is called mi\_optionBackButton on the stage. I’ve tried deleting the button and putting it back, but to no avail. No clue what I’m doing wrong here.

```auto
package
{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    
    public class DefaultButton extends MovieClip
    {
        public function DefaultButton()
        {
            trace(this.name);
            this.buttonMode = true;
            this.addEventListener(MouseEvent.CLICK, mouseClick);
            this.addEventListener(MouseEvent.ROLL_OUT, rollOut);
            this.addEventListener(MouseEvent.ROLL_OVER, rollOver);
            this.stop();
        }
        
        public function mouseClick(theEvent:MouseEvent)
        {
            Clixxor(root).DefaultButtonPress();
        }
        
        public function rollOut(theEvent:MouseEvent)
        {
            gotoAndStop(1);
        }

        public function rollOver(theEvent:MouseEvent)
        {
            gotoAndStop(2);
        }
    }
}

```

```auto
package
{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    
    public class BackButton extends MovieClip
    {
        public function BackButton()
        {
            trace(this.name);
            this.buttonMode = true;
            this.addEventListener(MouseEvent.CLICK, mouseClick);
            this.addEventListener(MouseEvent.ROLL_OUT, rollOut);
            this.addEventListener(MouseEvent.ROLL_OVER, rollOver);
            this.stop();
        }
        
        public function mouseClick(theEvent:MouseEvent)
        {
            Clixxor(root).BackButtonPress();
        }
        
        public function rollOut(theEvent:MouseEvent)
        {
            gotoAndStop(1);
        }

        public function rollOver(theEvent:MouseEvent)
        {
            gotoAndStop(2);
        }
    }
}

```
