# ActionScript

**URL:** https://forum.kirupa.com/t/actionscript/18743
**Category:** Uncategorized
**Created:** [April 20, 2003, 1:13pm UTC](https://forum.kirupa.com/t/actionscript/18743 "2003-04-20T13:13:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![luster](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@luster](https://forum.kirupa.com/u/luster)
#### Post date: [April 20, 2003, 1:13pm UTC](https://forum.kirupa.com/t/actionscript/18743/1 "2003-04-20T13:13:31Z")

</div>

Hi , I’m making a movie but I have a problem. In an MC named “balle”, I put this code:

onClipEvent (enterFrame) {  
this.\_x = this.\_x+\_root.posh;  
this.\_y = this.\_y+\_root.posv;  
}  
onClipEvent (load) {  
gotoAndPlay (1);  
}  
onClipEvent (load) {  
if this.\_x \<= 0;  
gotoAndPlay(“frame2”);  
}

\_root.posh is 4  
\_root.posv is 4  
Please help!

---

<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: [April 20, 2003, 1:33pm UTC](https://forum.kirupa.com/t/actionscript/18743/2 "2003-04-20T13:33:26Z")

</div>

well you odn’t need that many onclipevent (load)'s… THey can all be put into 1…  
and it should be

[AS]  
onClipEvent (load) {  
if (this.\_x\<=0) {  
gotoAndPlay (“frame2”)  
}  
}  
[/AS]

i assume “frame2” is the frame label, if its not, just put a ‘2’ without the brackets.

oh yea and u dotn’ need gotoAndPlay (1), it should do that itself. 🙂 That should be it i think…
