# OnClip Event to timeline as

**URL:** <https://forum.kirupa.com/t/onclip-event-to-timeline-as/294536>\
**Category:** flash\
**Created:** [August 16, 2009, 12:13am UTC](https://forum.kirupa.com/t/onclip-event-to-timeline-as/294536 "2009-08-16T00:13:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![firewheel](https://avatars.discourse-cdn.com/v4/letter/f/df705f/32.png) [@firewheel](https://forum.kirupa.com/u/firewheel)\
**Post date:** [August 16, 2009, 12:13am UTC](https://forum.kirupa.com/t/onclip-event-to-timeline-as/294536/1 "2009-08-16T00:13:03Z")

</div>

I’m trying to have an animation occur on a timeline and not on Enter frame, so instead of it doing a continuous loop it just does the animation twice then stops. Currently this code is on the movie clip itself and I want to move it to the main as code line so it animates then stops. Any way to change this to a function or something? Sorry I’m more of a designer…:sonic:

onClipEvent (enterFrame) {  
rpm = 35  
}  
onClipEvent (enterFrame) {  
\_parent.oscillateUsingCos(rpm);  
\_parent.spin(this, “horizontal”);  
}
