Help with "erase" button

7 posts

Flag Post

Hello I recently made a flash sketcher as some of you know. I know how to make buttons to draw with diffrent colors. However I’ve searched online countless times on actionscript to help me create an “erase” button that would clear the drawing board. I have no idea where to start, so any help would be appreciated (im very new to this flash thing, maybe a good 48 hours under my belt) Thanks for the help.

 
Flag Post

Hey weird I had the same Problem too…unfortunately I can’t remember what I did to resolve said problem :P Ill see if I can find that tutorial and type it up on the forum for ya! K L8trz

 
Flag Post

its easy isnt it just make a button and as in it with
on(press){
GotoAndStop(thenextframesnumber)
}
and on the next frame put this script:
GotoAndStop(framewhereyoudraw);

 
Flag Post

hmm I cant seem to get it to work I have it all on one frame your just drawing over yourself i believe.

 
Flag Post

Nqkoi1 yr script just pushes the current from ahead by one what happens when the user runs out of frames? Of course that could be an interesting dynamic making it into like some kind of limited page book let or something?

 
Flag Post

Lol phatcat its notlke that it pushes you to the next frame and returns you to the previous one and this way the painted should be deleted

 
Flag Post

Use the Movieclip.clear(); function. So for example, if the movieclip that your sketch is contained in is called “sketch”, then the code on your erase button would be:

on(release){
_root.sketch.clear();
}

This only clears stuff drawn in actionscript, i.e with lineTo, beginFill, etc.