# onClipEvent(Load) Question

**URL:** <https://forum.kirupa.com/t/onclipevent-load-question/2540>\
**Category:** flash\
**Created:** [June 12, 2002, 2:35pm UTC](https://forum.kirupa.com/t/onclipevent-load-question/2540 "2002-06-12T14:35:51Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [June 12, 2002, 2:35pm UTC](https://forum.kirupa.com/t/onclipevent-load-question/2540/1 "2002-06-12T14:35:51Z")

</div>

I have a movie with one layer and two keyframes.\rOn the first keyframe is a movieclip (instance name ‘MC’)\rwith the following actionscript\r\ronClipEvent (load) {\r&nbsp &nbsp &nbsp &nbsp xyz = 5;\r trace(xyz);\r}\r\rThe second keyframe is empty but holds the actionscript:\r\r\_root.MC.xyz = 10;\rtrace(\_root.MC.xyz);\r\r\rmy question is when i test the movie … why does the trace action constantly ouput 5s ?? shouldnt it output 5 once and then costantly output 10s? because isnt a movieclip only loaded once??\r\rbit confused here…any help appreciated…thanks

---

<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:** [June 12, 2002, 5:47pm UTC](https://forum.kirupa.com/t/onclipevent-load-question/2540/2 "2002-06-12T17:47:25Z")

</div>

you have two frames on the main timeline, so it will loop and continue referencing frame 1

---

<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:** [June 12, 2002, 8:49pm UTC](https://forum.kirupa.com/t/onclipevent-load-question/2540/3 "2002-06-12T20:49:50Z")

</div>

yes but when the playhead goes over frame 2, why doesnt it change the variable to 10?\r\rand another thing is- isnt a movie clip only loaded once? i.e not everytime the playhead moves over it?\r\rcheers

---

<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:** [June 13, 2002, 5:36am UTC](https://forum.kirupa.com/t/onclipevent-load-question/2540/4 "2002-06-13T05:36:20Z")

</div>

because the second frame is empty (the movie doesn’t exist), when the playhead moves back to one, the movie is loaded, and the load event fires again.\r\rtry putting the frame actions on one level in frame 2, and the clip on another level which spans both frames. then you’ll get the result you’re expecting.
