PDA

View Full Version : drawing board ,draw straight line



hotbeng
April 17th, 2005, 01:45 AM
i heave learnt how to create a drawing board in flash mx 2004 for use to draw line from this thread http://www.kirupa.com/developer/actionscript/drawingboard.htm
but i need some help here

Question1:ie. i draw 3 line means i am in step 3 , how can i undo to step 2 ?how to create actionscript for undo?

Question2: how to erase for example the line i drawn out in this drawing board during test scene or test movie?

Question3:how can i specify the range/area for the drawing board as i have no intention for it to cover full scale ?

Seticus
April 17th, 2005, 05:29 AM
for question 1: everytime you create a line, create a new empty mc (createNewEmptyMovieClip()) and draw your line into that one. Later on you can remove that mc (or another) using mc.removeMovieClip()

question 2: (don't fully understand the question, hope I got this right) to erase the current line, just make a new empty mc on the same level, and it will overwrite the old line.

question 3: there are two options: you stop drawing when you get out of the range, remember the x and y- positions and when you back into range you start drawing again from the saved positions
second option: you use a ball instead of your mouse to draw a line, when dragging the ball, you're drawing a line from it. when you drag it out of range, you stop the drag (stopDrag()), this way the user can make a drawing the doesn't jump to another position (like in the first example)

good luck

hotbeng
April 18th, 2005, 09:36 PM
now i have a button i named it as btn_home
and i put actionscript like this

btn_home.onRelease = function()
{
_root.line.clear();
mc.removeMovieClip();
gotoAndPlay("homepage",1);
};


but when i go to scene homepage, i still can draw line which is not i wanted

how can i remove the button fuction or movieclip so that other scene wotn allow me to draw line during test movie?