# onClipEvent problem

**URL:** https://forum.kirupa.com/t/onclipevent-problem/62726
**Category:** flash
**Created:** [August 30, 2004, 10:09pm UTC](https://forum.kirupa.com/t/onclipevent-problem/62726 "2004-08-30T22:09:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mprzybylski](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mprzybylski/32/613_2.png) [@mprzybylski](https://forum.kirupa.com/u/mprzybylski)
#### Post date: [August 30, 2004, 10:09pm UTC](https://forum.kirupa.com/t/onclipevent-problem/62726/1 "2004-08-30T22:09:06Z")

</div>

Hello,  
I have a button with an instance name of “sub1” and inside of this button frame one has a stop action and frame 2-10 is a tween of it moving up with a stop action on frame 10. on this button i have a script that says the following:

```auto
onClipEvent (load) {
 	this.gotoAndPlay(2);
 }

```

so this button is supposed to go and play out the animation from frame 2 to 10 when i test the movie, however it plays frame 2 and stops there so it just moved up a little bit.

what i am trying to achieve is i want this button to be on frame 10 when the entire movie loads because its button 1 of my 3 buttons that move up and down and the first one shows an image which automatically loads when the page is open so i want that buttons “up” state to be at frame 10 when the movie loads as well. is my code incorrect or should i be doing something different all together?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 31, 2004, 4:12am UTC](https://forum.kirupa.com/t/onclipevent-problem/62726/2 "2004-08-31T04:12:17Z")

</div>

anyone have any clues on this? it is much appreciated…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 31, 2004, 7:20am UTC](https://forum.kirupa.com/t/onclipevent-problem/62726/3 "2004-08-31T07:20:44Z")

</div>

problem fixed, it was the following code in case anyone was interested:

```auto
// put first button up
sub1.onEnterFrame = function() {
		if (this._currentframe == 10) {
			delete this.onEnterFrame;
		} else {
		this.nextFrame();
		}
	};

```
