# On clip event

**URL:** https://forum.kirupa.com/t/on-clip-event/111508
**Category:** Uncategorized
**Created:** [May 27, 2004, 6:14pm UTC](https://forum.kirupa.com/t/on-clip-event/111508 "2004-05-27T18:14:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rlLife](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@rlLife](https://forum.kirupa.com/u/rlLife)
#### Post date: [May 27, 2004, 6:14pm UTC](https://forum.kirupa.com/t/on-clip-event/111508/1 "2004-05-27T18:14:36Z")

</div>

i am having problems making this code work with onclip event or on enter frame. i know that if i change the code to mybutton.onRelease it will work but i want it to work with on enter frame or on clip event.

```auto
onClipEvent = function() {
	for (i=0; i<t_xml.length; i++) {		
		if (deingabe_txt.text == t_xml*.attributes.datum) {
			_level1.playSFX("Transfer");
			currentD = t_xml*.attributes.datum.split('.')[0];
			currentMonth = t_xml*.attributes.datum.split('.')[1]-1;			
			currentYear = t_xml*.attributes.datum.split('.')[2];
			cleanUp();       
    		displayMonth(currentMonth, currentYear);
			anzeige_txt.text = this._parent["date"+currentD].weekday+"
"+(((((currentD+" ")+monthArray[currentMonth])+" - ")+curYear));
			news_txt.htmlText = "<font color='#ff0000'>"+t_xml*.attributes.titel+"</font><br><br>";
			news_txt.htmlText += t_xml*.firstChild+"<br><br>";
			if (t_xml*.attributes.links != undefined) {
				news_txt.htmlText += "<p align='right'><font color='#ff3300'>[<a href='"+t_xml*.attributes.links+"'>Jump</font>]</a></p>";
			}
			deingabe_txt.text = "";
			break;
		} else {			
			news_txt.htmlText = "Kein Termin!";			
		}
	}
}

```

---

<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: [May 27, 2004, 6:17pm UTC](https://forum.kirupa.com/t/on-clip-event/111508/2 "2004-05-27T18:17:55Z")

</div>

Well, there are two things. First, is this on a frame or a movieclip?

If it’s on a frame, it needs to be  
onEnterFrame = function() {

If it’s on a movieclip, it should be  
onClipEvent(enterFrame) {

Didn’t look at the rest of the code… but that was what i saw right off.
