# FMX: load and unload functions

**URL:** <https://forum.kirupa.com/t/fmx-load-and-unload-functions/14436>\
**Category:** flash\
**Created:** [February 26, 2003, 3:33am UTC](https://forum.kirupa.com/t/fmx-load-and-unload-functions/14436 "2003-02-26T03:33:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [February 26, 2003, 3:33am UTC](https://forum.kirupa.com/t/fmx-load-and-unload-functions/14436/1 "2003-02-26T03:33:35Z")

</div>

Hi there.  
I’m currently playing with the draw API function within Flash MX.  
So i have a MC containing 2 buttons (1 per frame).

so it goes: (1st frame 1st button)  
for the button:

on (press){  
createEmptyMovieClip(“myClip”,1);  
myClip.lineStyle(12,0xFF0000,100);  
nextFrame();

and a Stop(); for the frame

(2nd frame 2nd button)  
for the button:

on (press){  
prevFrame();  
}

and on the frame:  
onMouseDown = function () {  
myClip.moveTo(\_xmouse, \_ymouse);  
onMouseMove = function () { myClip.lineTo(\_xmouse, \_ymouse);};  
};  
onMouseUp=function(){  
onMouseMove=null;  
}  
stop();

SO this works, when i click the 1st button, my button changes to the 2nd one and it draws wherever i move the mouse.  
My problem is i wanna disable the function when i come back to the 1st frame so it doesnt draw anymore. I’m having 2 buttons cause i have some other code i haven’t written here cause it’s no use for my prob.

Can anyone help me out?

TiA  
😉

---

<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:** [February 26, 2003, 4:18am UTC](https://forum.kirupa.com/t/fmx-load-and-unload-functions/14436/2 "2003-02-26T04:18:24Z")

</div>

bahh i’m tired or blind, not sure yet…  
In fact i just added

onMouseUp = function () {myClip.moveTo=null;onMouseMove = function () {myClip.lineTo=null;};  
};  
stop();

to my 1st frame and it works…

It just reply to my own post in case someone was wondering the same…
