# Quick OOP question

**URL:** <https://forum.kirupa.com/t/quick-oop-question/228912>\
**Category:** flash\
**Created:** [June 12, 2007, 2:36pm UTC](https://forum.kirupa.com/t/quick-oop-question/228912 "2007-06-12T14:36:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thusandso](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@thusandso](https://forum.kirupa.com/u/thusandso)\
**Post date:** [June 12, 2007, 2:36pm UTC](https://forum.kirupa.com/t/quick-oop-question/228912/1 "2007-06-12T14:36:34Z")

</div>

\*\*EDIT: DISREGARD, a Flash bug caused the problem (keyframe of a mask interfered with a button, which it technically should NOT have [and doesn’t elsewhere in the movie]… not a code problem, just a Flash bug that took me forever to figure out).

KEY:\*\*

“\_root” = root  
“main” = MC  
“main.homeButton” = button within main MC

**This code is on Frame 1 of the root timeline:**

```auto
//BUTTON NAVIGATION
main.homeButton.onRollOver = function() {
    main.homeButton.gotoAndPlay("over");
}
main.homeButton.onRollOut = function() {
    main.homeButton.gotoAndPlay("out");
}
main.homeButton.onPress = function() {
    main.gotoAndPlay(10);
}

```

**DESCRIPTION:** On Frame 1 of the root timeline is an MC called “main.” Within that is a button called “homeButton.”  
\*\*  
THE PROBLEM:\*\*  
This code jumps the playhead _off_ FRAME 1 of the root timeline and _into_ “main” MC:

```auto
main.homeButton.onPress = function() {
    main.gotoAndPlay(10);

```

Since the rollover effects of the button are on FRAME 1 of the root timeline, the button no longer functions when rolled over (or clicked) after the initial onPress is triggered. This is due to the fact that the playhead is now stuck in frame 10 of the “main” MC.

I just want the “main” MC to play without moving the playhead off FRAME 1 of the root timeline (where all my actionscript is!).

I don’t undrestand the problem, really, \*\*because this rollover code does _NOT_ jump the playhead off the root timeline:  
\*\*

```auto

main.homeButton.onRollOver = function() {
    main.homeButton.gotoAndPlay("over");
}
main.homeButton.onRollOut = function() {
    main.homeButton.gotoAndPlay("out");
}
}

```

**But, for some reason this onPress code _DOES_:**

```auto

 main.homeButton.onPress = function() {
     main.gotoAndPlay(10);
 }

```
