# Another option for onEnterFrame

**URL:** <https://forum.kirupa.com/t/another-option-for-onenterframe/264519>\
**Category:** flash\
**Created:** [June 26, 2008, 7:58pm UTC](https://forum.kirupa.com/t/another-option-for-onenterframe/264519 "2008-06-26T19:58:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ihookcreative](https://avatars.discourse-cdn.com/v4/letter/i/e495f1/32.png) [@ihookcreative](https://forum.kirupa.com/u/ihookcreative)\
**Post date:** [June 26, 2008, 7:58pm UTC](https://forum.kirupa.com/t/another-option-for-onenterframe/264519/1 "2008-06-26T19:58:41Z")

</div>

Hey Guys-

I have a code the moves an image 10 pixels on every frame. I need this to happen still but I only have one frame. What can I do besides the onEnterFrame for this code so it will still move without stopping?

pic1\_mc.onEnterFrame = function() {  
pic1\_mc.\_x += 10;  
if(pic1\_mc.\_x \>= 374) {  
pic1\_mc.\_x = -276;  
pic1\_mc.loadMovie(myPics[curPic++]);  
if(curPic \>= myPics.length) {  
curPic = 0;

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 26, 2008, 9:58pm UTC](https://forum.kirupa.com/t/another-option-for-onenterframe/264519/2 "2008-06-26T21:58:58Z")

</div>

I think we have a winner!

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [June 27, 2008, 12:38am UTC](https://forum.kirupa.com/t/another-option-for-onenterframe/264519/3 "2008-06-27T00:38:18Z")

</div>

[quote=randomagain;2349896]I think we have a winner![/quote]Don’t reply unless there’s an actual purpose… if people search and see there’s a reply, they’d expect something helpful.

Not the clearest of questions though, from what I think this is just a misunderstanding of how onEnterFrame works. onEnterFrame runs whenever … well, flash enters a frame; this is independent of the actual number of frames there are in a movie(clip). If you have 1 frame and a frame rate of 30 an onEnterFrame will run 30 times a second regardless

---

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [June 27, 2008, 11:24am UTC](https://forum.kirupa.com/t/another-option-for-onenterframe/264519/4 "2008-06-27T11:24:41Z")

</div>

you can always use the tween class with a yoyo…?

dont understand your question…
