# On clip event

**URL:** https://forum.kirupa.com/t/on-clip-event/52816
**Category:** Uncategorized
**Created:** [May 27, 2004, 6:14pm UTC](https://forum.kirupa.com/t/on-clip-event/52816 "2004-05-27T18:14:36Z")
**Posts on this page:** 1
**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/52816/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!";			
		}
	}
}

```
