Eraser Tool For Drawing App...
hi, i have been creating a paint tool in flash using the built in api drawing, im using flash8 as2.
for an erasor tool i set the brush to paint at background colour, which works as long as i have a solid one colour background, however in my project the background the user draws on will be a user selected section of a background type enviroment, in other words a section of a wall to paint on choosen by the user.
Thus i would like to find out how to create an eraser tool that works by deleting pixels rather than painting a background colour does anyone know what actionscript i would need to use? thanks.
i have included the .fla
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 11-03-2005, 05:55 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Brush Tool And Eraser Tool Troubles
i've been using flash for over a year and a half and i've NEVER came across this problem.
when i go inside a movieclip to edit it, it won't let me use the brush tool or eraser.
unless i draw a circle around the area i want brushed or erased.
what the crap did i do?
keep in mind that it works normal when i'm on the main timeline.
thanks for any help!
-nolen
Eraser Tool
Hi
Does anyone know how i can make a rectangular selection in wich i can use the eraser tool, like in photoshop?
thx
Eraser Tool 2
hi
does anyone know how i can use the eraser-tool in a smooth mode like in photoshop to get smoothed out borders of the erased area. i can only find an option for round or rectangular erasers.
thx
[F8] Eraser Tool
Can someone tell me if I can use the eraser tool on a bitmap or a graphic? And if not what can I do if I want to erase a piece of the bitmap or graphic?
Thank you!
Eraser Tool
I did google to find information about AS3 eraser that is able to erase the part
of drawing on a canvas. However, no luck for me to find the information about the eraser's AS3. Can you tell me how to make the eraser tool?
Thank you very much.
Eraser Tool Stuck On
my eraser tool is stuck on and I can't use any other tools... tried restarting: app, comp, new doc, checked every menu and preferance... WTF man... I'm on a deadline and I'm stuck with only my eraser tool... help me!
Eraser Tool Will Not Erase
My eraser tool will not maintain the area that I erased when I lift my pen from my drawing tablet..
I have never been able to erase like in photoshop..
What do I need to do to erase a portion of some text that I created on the stage?
I am trying to erase a part of a letter, but the eraser disappears when I lift my pen.. Something seems to be locked....
A Working Eraser Tool.
I've seen a few examples of drawing programs but they hardly ever have real eraser tools. They either replace something with white, delete entire objects, or don't even have one. I created this one just to show how it's done for those who don't know.
http://mattkenefick.com/blog/2008/11...-actionscript/
If you want to use shapes for speed, simply create a Sprite object... On MOUSE_DOWN you do your drawing techniques, then on MOUSE_UP, you draw the Sprite to the BitmapData layer and Sprite.clear() your shape.
Easy as pie and allows a real eraser.
Can Eraser Tool Save The Day?
Hi, I have a mostly static background image of a runway photo with a model who poses a few different ways as the surrounding paparazzi flash cubes go off. Flash animates the model's poses and the random sequence flash bulbs.
If I import rough-edged versions of the model's poses and flash bulbs, then use the Flash CS3 Pro BREAK APART command to more accurately erase/feather the edges, wouldn't I be able to layer those over my background, and save a ton of space by converting the background image to a symbol for each frame? For that matter, couldn't I also convert the feathered-edged variations into symbols as well, to save even more space?
My current problem is that I imported about 20 copies of the same background graphic with the different model poses and flash bulb locations with layers, and it made my file HUGE. Please let me know if Flash can do this. Thanks!
Drawing Board Help Brush Stroke, Eraser, Color
Hello, how's it going?
I'm stuck in a rut as I'm not an actionscripter. For one of my classes I have to create something "fun". So I am creating a drawing board. The question is, I have the ability to change the color, change a different brush stroke, but only stays black. But what I want it to do, is change the color of the brush stroke and still keep it that color until the user changes the color. The file is located here:
http://www.vekturlab.com/flash/vekturlabflash.fla
Thank you in advance!
P.S. I've searched the whole forum for a couple of days before I posted this.
[F8] Non API Drawing Tool
I have a movieclip in the library with linkage "dot". I would like to make a drawing tool out of this movie clip. Could anyone provide me with a code to make the dot spawn at the mouse point when you click?
Drawing Tool
Hi,
Attaching the flash file....
Currently I m drawing a line ...storing its x and y position in an array...
Now I want create movieClip that should splitted into small pieces...
Its working when u draw a line with slow mouse movement..
however.....if u move the mouse very fast ...then a small gap is coming between the small movieClips...
Hope u understand the exact problem...
So...now pls help ...
Drawing Tool Problem
Still referred to the zeichnen drawing tool.
Problem is:
i have this mouse drawing on duplicating a mc called "line", with a first frame saying: startDragmctrue.
i have some buttons at the top to change the "line" color.
How to go on the buttons avoiding the possibility to draw on the buttons?
If i put in the first frame "constrain to trectangle" i evitate to draw on the button but the button doesn't works.
I'm sure is a stupid question.
Flash Drawing Tool
http://www.imaginationatwork.com/imagine
I want to create something similar to this for a client of mine.
Does anyone have any idea how this was created?
I have made a basic drawing tool that allows you to draw lines and change the colour/size. However, I have absolutely no idea how you get the server to record what someone has drawn and then play it back.
Does anyone have any ideas? Are there any relevant tutorials, source code or text books I can look at?
Any help would be most appreciated.
Many thanks for your time,
Neil
Need Some Help - Simple Drawing Tool
Hi,
Well maybe not SO simple -- the drawing tools on tutorials dont do waht I'm trying to get, and I've had a tough time trying to modify them just right.
What I'm trying to do is simple though!
A solid color BG and a solid color pen nib - a circle about 60 pixels wide. the catch is, it is a click and drag style pen -- on the flash page it's actually an abstract sun, and i want to let people drag it around. so they can't just click on the canvas, it has to be a dragging thing.
Any advice/help with this would be MUCHLY appreciated.
Thanks
Frizzo
Drawing Line Tool
Hi,
I'm a newbie using Flash CS4 and AS3. A retired social worker, I need to create a basic Flash drawing tool for an eLearning project to teach students how to draw their family tree.
The drawing tool would allow the students to add multiple circles and squares to symbolize their family members, plus text labels for names, ages, and they would need to be able to draw connecting lines between the circle and square symbols. Finally, in order to continue work on the drawing, over time, they would need to be able to save their drawings to be re-opened and edited (add new symbols, erase incorrect ones, etc.). Once the drawing is completed, they would need to be able to print a copy.
Being a newbie (but I have done some related scripting: JavaScripting-ECMA-262, HTML, CSS), I am not sure if this can be done in AS3, Flash CS4. But, if it is possible, I would like to learn how to create this. I would very much appreciate any help, especially examples that I can learn from, expand on.
Thanks for your help.
Kind Regards,
saratogacoach
Line Tool (for Drawing App)
right now i can create a straight line from mouse down to mouse up. what i cant quite get is a preview of that line. does anyone know of a simple way to show a preview of the line while the mouse is still down and the user is moving the mouse?
what i have now:
Code:
var clip:Shape = new Shape();
addChild(clip);
stage.addEventListener(MouseEvent.MOUSE_DOWN, startLine);
stage.addEventListener(MouseEvent.MOUSE_UP, drawLine);
function startLine(evt:MouseEvent) {
clip.graphics.moveTo(mouseX, mouseY);
}
function drawLine(evt:MouseEvent) {
clip.graphics.lineTo(mouseX, mouseY);
clip.graphics.lineStyle(1, 0xff9933);
}
Drawing Tool On Line
hi
(i'm italian, sorry about my english)
I want to put on a web page a simple "drawing tool" (like the Ms Wndows Paint), so users can make a simple drawing and so send it to the site administrator.
there is any example or link you can give me?
thanks
marco
Drawing Tool In Flash
hi all,
can someone plz post a tutorial or link from where i can learn to make a drawing application in flash, in which i can draw a line and rectangle at runtime and also can change their size. or is there any free component for that? thanks for any support.
[F8] Saving Output Of Drawing Tool
i am creating a drawing tool using flash 8,After creating any shape with it ,i want to save this shape to my computer as swf or jpeg or any extention.
so i can relaod it in another flash movie to view it as an image
all this must be done on the run time.
please can any one help me?
Drawing Program - Text Tool
Hi I'm building a drawing program and i would like to include a text tool.
I'm thinking maybe a select box of all the fonts, a bold and an italic option, font size etc...
Is there a component that I can use for this?
Thanks in advance
Flash Drawing App - Line Tool
I have created a Flash drawing application that has a basic brush tool, that you can change sizes and colors for. Nothing fancy. I would like to add a line tool, simlilar to the one in Photoshop, that you can draw straight lines with. Does anyone have any suggestions or tips for doing that? Thanks for any help you can give.
Drawing With Pen Tool - Anchor Points Problem
Hi everyone (my first post here!)
I would like to know if it is possible to prevent flash from automatically adding anchor points to my drawings.
The thing is I would like to do consecutive shape tweenings but flash keeps adding anchor points.
So I used shape hints for the first tween but when I want to add hints for the second tween it kinda bugs and removes the first tween?!?
I am using flassh mx btw.
Any help appreciated.
Eraser
ok i have been working on a hilite tool thats coming along great... i am going to be adding a color chooser for the user to differentiate the hi-lites and already have an "erase all" button, but was wondering if it is possible using the draw function to create an eraser that acts just like a photoshop type eraser?
Eraser...
Hi Flashers!!
My main goal is to make an eraser which will reveal a picture. So far so good. If anybody is willing to help please get the zip file which will be very helpfull. I made some screenshots in photoshop for help.
1). map jpg: That's the map
2). the map is covered with a black layer
3).the user changes (somehow) the _alpha property (before starting revealing the image) to -let's say- 60% and reveals with the eraser the path of the map up to some point.
4).the user sets the _alpha of the cover back to 100% in order to get the picture shown in the example.
I hope u got what i mean. Thanks in advance for your help. It's very important to to me.
Eraser...
Hi Flashers!!
My main goal is to make an eraser which will reveal a picture. So far so good. If anybody is willing to help please get the zip file which will be very helpfull. I made some screenshots in photoshop for help.
1). map jpg: That's the map
2). the map is covered with a black layer
3).the user changes (somehow) the _alpha property (before starting revealing the image) to -let's say- 60% and reveals with the eraser the path of the map up to some point.
4).the user sets the _alpha of the cover back to 100% in order to get the picture shown in the example.
I hope u got what i mean. Thanks in advance for your help. It's very important to to me.
Text Eraser
Hi :
I would like to make some dynamic text which fades as a new line appear, and then fades away. but I have not been able to do so.
please let me know if you have any ideas flash MX or 5
Eraser Not Working
I am attempting to create an animation that looks like a brush is painting the letter A. I'm creating two layers, the one with the text that will appear in increments, and the one with the brush moving along in synch. My problem is that I can't get the eraser tool to erase the parts of the letter that I want it to in each frame. I did make sure to check that eraser mode is set to normal.
Here's what I did:
1. created text box and typed my letter in frame 1 keyframe.
2. created another keyframe 24 frames out.
3. attempted to erase portion in frame 23 with the intention of erasing a little more on down each frame back to 1.
4. the portion would seem to erase, but when I let up on mouse button, it would reappear.
5. started over, and did step 1, but this time changed text to a symbol
6. followed the rest of the steps only to have the eraser tool do the same thing.
What am I missing?
-m-
Eraser Mask
I have searched for tutorials for this effect but haven't been able to find one. What I am trying to do is create a mask and I want it to erase a sold black graphic which will then show the site. If anyone know of a tutorial on how to do this that would be great. Or if you know how to do this I would greatly appreciate it if you would help me out.
Thanks
ERASER (advanced)
Hi Flashers!!
My main goal is to make an eraser which will reveal a picture. So far so good. If anybody is willing to help please get the zip file which will be very helpfull. I made some screenshots in photoshop for help.
1). map jpg: That's the map
2). the map is covered with a black layer
3).the user changes (somehow) the _alpha property (before starting revealing the image) to -let's say- 60% and reveals with the eraser the path of the map up to some point.
4).the user sets the _alpha of the cover back to 100% in order to get the picture shown in the example.
I hope u got what i mean. Thanks in advance for your help. It's very important to to me.
Eraser Kind Of
Hi
I'm creating a drawing api where I have used lineTo/moveTo methods to create line drawing. now i want to create a eraser kind of effect which can be like eraser removing parts of the lines.
This should not be clear function which clears all the drawing at once.
It should behave like an eraser. Like on hittest it should remove that part of the line.
Is it possible???
Please guide.......its urgent!!
Thanx
Dynamic Eraser
is it possible to make a dynamic eraser that the user
uses to erase any part of a drawing that is made
with Drawing API?
Api Eraser Any Solution In 3.0 Or Not Yet
Eraser for lines drawn using api in many applications was a big issue since long does as 3.0 have a solution for it or still we have to clear it all in one step
aaa.clear()
Thanks in advance
Bitmap Eraser
I'm trying to make an AS3 version of senocular's Erase and Redraw http://www.senocular.com/flash/source.php?id=0.175. I've gone over the code and converted it over to AS3. It all seems pretty straight forward. My problem is when I draw with the eraser it erase's with the entire bitmap shape not just the alpha. I can not figure out why.
The below code creates the actual eraser bitmapData. A white square with a transparent circle.
Code:
var eraser:BitmapData = drawEraser();
private function drawEraser():BitmapData {
var diamX:int = 50;
var diamY:int = 50;
// Below creates a black circle that will be the eraser's shape.
eraserShape.graphics.clear();
eraserShape.graphics.beginFill(0x000000, 1);
eraserShape.graphics.drawEllipse(0,0,diamX,diamY);
eraserShape.graphics.endFill();
// New bitmapData created and filled with white.
var eraserShapeBMD:BitmapData = new BitmapData(diamX, diamY, true, 0);
eraserShapeBMD.fillRect(eraserShapeBMD.rect, 0xFFFFFFFF);
// Copy the black brush shape to the bitmapData object. Image will then be a black circle on a solid white background.
eraserShapeBMD.draw(eraserShape);
// Copy the red channel to the alpha channel. This leaves a solid white square with a transparent circle.
eraserShapeBMD.copyChannel(eraserShapeBMD, eraserShapeBMD.rect, zeroPoint, BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
drawEraserCursor();
return eraserShapeBMD;
}
The below function is triggered when the mouse is pressed and moves.
Code:
private function drawPoint (xMouse:int, yMouse:int):void {
var zeroPoint:Point = new Point(0,0);
selectedLayer.bitmapData.copyPixels(selectedLayer.bitmapData, eraser.rect, new Point(xMouse-eraser.width/2, yMouse-eraser.height/2), eraser, zeroPoint, false);
}
Eraser Effect?
I want to do an automatic eraser effect, basically after you click on it, it erases the image in a back and forth motion, like a pencil eraser.
the only problem is, i want the eraser size to be larger than what flash allows it to be.
can this be done in some way with some type of mask or is there a way to erase it efficiently by breaking apart the image and erasing piece by piece without it looking too choppy?
Eraser Problems
With my flash my eraser is always a big square, it cant be changed, when you chenge it the shape inside the eraser changes, but it stays a square, is there a way to correct this or should i reinstall flash?
Adding An Eraser
Hi there, I have a sketch pad and it works and everything, but I need like an eraser to be added on. Anyone keen on taking a look? Any help is appreciated. Thank you!
(See the attached file)
Here is the code:
lineThickness = 0;
selectedColor = "0x000000";
_root.onMouseDown = startDrawing;
_root.onMouseUp = stopDrawing;
function startDrawing() {
if (_xmouse<455) {
_root.lineStyle(lineThickness, selectedColor);
_root.moveTo(_root._xmouse, _root._ymouse);
_root.onMouseMove = drawLine;
}
this.attachMovie("cursor_id", "cursor_mc", this.getNextHighestDepth(),
{_x:_xmouse, _y:_ymouse});
Mouse.hide();
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
pencil._x = _xmouse;
pencil._y = _ymouse;
updateAfterEvent();
};
Mouse.addListener(mouseListener);
this.createEmptyMovieClip("drawing_mc", this.getNextHighestDepth());
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
this.drawing = true;
drawing_mc.moveTo(_xmouse, _ymouse);
};
mouseListener.onMouseUp = function() {
this.drawing = false;
};
mouseListener.onMouseMove = function() {
if (this.drawing) {
drawing_mc.lineTo(_xmouse, _ymouse);
}
updateAfterEvent();
};
Mouse.addListener(mouseListener);
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.DELETEKEY) || Key.isDown(Key.BACKSPACE)) {
drawing_mc.clear();
}
};
Key.addListener(keyListener);
}
function drawLine() {
_root.lineTo(this._xmouse, this._ymouse);
}
function stopDrawing() {
delete this.onMouseMove;
}
line0.onPress = function() {
lineThickness = 0;
};
line3.onPress = function() {
lineThickness = 3;
};
line6.onPress = function() {
lineThickness = 6;
};
line9.onPress = function() {
lineThickness = 9;
};
line12.onPress = function() {
lineThickness = 12;
};
colorRed.onPress = function() {
selectedColor = "0xFF0000";
};
colorGreen.onPress = function() {
selectedColor = "0x00FF00";
};
colorOrange.onPress = function() {
selectedColor = "0xff9900";
};
colorBlue.onPress = function() {
selectedColor = "0x00FFFF";
};
colorYellow.onPress = function() {
selectedColor = "0xFFFF00";
};
colorDblue.onPress = function() {
selectedColor = "0x0000FF";
};
colorPink.onPress = function() {
selectedColor = "0xFF00FF";
};
colorPurple.onPress = function() {
selectedColor = "0x6633CC";
};
colorBlack.onPress = function() {
selectedColor = "0x000000";
};
Bitmap Eraser
I'm trying to make an AS3 version of senocular's Erase and Redraw http://www.senocular.com/flash/source.php?id=0.175. I've gone over the code and converted it over to AS3. It all seems pretty straight forward. My problem is when I draw with the eraser it erase's with the entire bitmap shape not just the alpha. I can not figure out why.
The below code creates the actual eraser bitmapData. A white square with a transparent circle.
Code:
var eraser:BitmapData = drawEraser();
private function drawEraser():BitmapData {
var diamX:int = 50;
var diamY:int = 50;
// Below creates a black circle that will be the eraser's shape.
eraserShape.graphics.clear();
eraserShape.graphics.beginFill(0x000000, 1);
eraserShape.graphics.drawEllipse(0,0,diamX,diamY);
eraserShape.graphics.endFill();
// New bitmapData created and filled with white.
var eraserShapeBMD:BitmapData = new BitmapData(diamX, diamY, true, 0);
eraserShapeBMD.fillRect(eraserShapeBMD.rect, 0xFFFFFFFF);
// Copy the black brush shape to the bitmapData object. Image will then be a black circle on a solid white background.
eraserShapeBMD.draw(eraserShape);
// Copy the red channel to the alpha channel. This leaves a solid white square with a transparent circle.
eraserShapeBMD.copyChannel(eraserShapeBMD, eraserShapeBMD.rect, zeroPoint, BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
drawEraserCursor();
return eraserShapeBMD;
}
The below function is triggered when the mouse is pressed and moves.
Code:
private function drawPoint (xMouse:int, yMouse:int):void {
var zeroPoint:Point = new Point(0,0);
selectedLayer.bitmapData.copyPixels(selectedLayer.bitmapData, eraser.rect, new Point(xMouse-eraser.width/2, yMouse-eraser.height/2), eraser, zeroPoint, false);
}
Any help would be great.
Logo Appaers After The Eraser Went Over?
Hello there,
I wonder if there is a tutorial or can someone tell me how to make an eraser that moves over my logo, that the logo appaers on the screen.
Any suggestions are welcome
Guust
FlashMX2004Pro Eraser Script Help
Hello all!
I need to do a job for my boss and im having a hard time trying to figure out how to make some stuff in AS. The work is a christmas e-card and the user needs to wipe out all the snow on the screen to see the christmas message. Now, i used a script that simulates a brush that will erase a mask layer that will show the image behind it (please look at http://www.flashkit.com/movies/Utili...8800/index.php). That works well to erase the snow. Now, my problem is: how can i tell Flash that all the snow is cleared so he can go to another scene? Do you guys think there is another way (simplier) to do this (not using this eraser script)?
Thanks all in advance!
John
Eraser + Other Tools Not Working
when ever i try to erase something it starts to but once i let go of the mouse button it doesnt stick it goes back to the way it was, it does this with other tools as well, whats wrong?
Paint And Eraser Are Wrecked
if i use the paint brush or the eraser tool (ONLY in the file that im making my game in)they are being stupid. the paint brush only fills INSIDE what i just colored, Ex i draw a circle and only the inside of the circle(what i didnt want to draw) shows up. and i can only erase by drawing a loop around what i want to erase, i cant move in one motion to erase a single line, it has to be a chunk of fill. i have checked the options for both and they are on normal erase and normal fill. can someone help me? (its acting like the lasso tool but with other tools effects.)
Creating An Eraser In Flash?
How do I create an eraser in flash? I thought maybe the drawing API, but i'm unsure on how to implement it. Any help would be appreciated. Thanks.
|