Flash :: Erasing A Specific Selected Portion Of A Bitmap?

Apr 20, 2011

I have two layers namely topLayer_mc and bottomLayer_mc. The actual vector drawing is drawn on the top layer and onmouseUp of the tool, a bitmap copy of the vector graphics on the top layer is taken and added as a bitmap to the bottom layer. The top layer is cleared subsequently. It is working for the pencil tool.Now I need to create an eraser tool. This is where things get tricky. In the application there is an option to save the image as png, so alpha has top be preserved. So the coventional method of draw a brush using the vector and using the draw method of bitmap will not work. Of course, on a visual level it would work if the brush drawn using the vector is to have the same color as that of the background.

What I need is to excatly erase the pixels.Now I have created a brush tool using the conventional technique and clearing is possible but what I need is to exactly erase the pixels. Is there some technique to draw this ? This is the code that I am using: I have also uploaded the swf and source code, When trying out, please draw all over the stage using the pencil (press Pencil button and start drawing)The source fla is also provided.

View 4 Replies


Similar Posts:


Actionscript 3 :: Update A Portion Of A Bitmap With A Pixelbender Instead Of The Whole Bitmap?

Feb 17, 2012

In pure AS3, I have a pixelbender and a large bitmap. The pixelbender is configurable with a distance parameter to affect only a small area of the bitmap. The problem is that the pixelbender is executing over the whole bitmap. What would be the best way to update only the effected region of the bitmap? Given this config:

[Code]...

View 1 Replies

Flash :: Show A Bitmap Which Is Only A Portion Of Its BitmapData In AS3?

May 14, 2011

I am writing a screen scroller for a game I'm making. There's a BitmapData object which holds the background graphic, yet I do not want to show/render it on screen all at once.

For example, I want to show only a 500x500 section of the data but the entire BitmapData is 1000x1000. I wanted to use the scroll() method to scroll the data but my problem is that I cannot restrict how much of the BitmapData is drawn on the Bitmap. I tried setting the height/width properties of the BitmapData to 500x500 (and draw all the 1000x1000), but any data drawn beyond the boundaries I defined is not really drawn.

Another option I considered is to store a different BitmapData object which holds the entire data, and then use copyPixels() from it to the one used on the Bitmap itself, although then I cannot use scroll() and have to use different methods to achieve scrolling.

View 4 Replies

ActionScript 3.0 :: Erasing Parts Of A Bitmap?

Mar 20, 2009

I'm in need, again, of some assistance. I'm making a game with 2 pictures. and the concept is built on that you erase part of the top-bitmap to see the bitmap under.How can I accomplish this?I tried to wrap my head around the bitmaps and the draw and the FillRect but can't get it to work completely.Basically I want 2 bitmaps, and a cursor which erases parts of the top one to show the one underneath.

View 5 Replies

ActionScript 3.0 :: Erasing A Circle From Bitmap Data?

Sep 29, 2009

I'm trying to create sort of an eraser to remove sections of a bitmap on stage.

I have achieved this by creating a MovieClip in flash that is a circle and exporting it as a Class called Hole.

Now I use this MovieClip to erase a circle section of the image using the following.

var mat = new Matrix();
var ct = new ColorTransform();
var hole = new Hole();
mat.translate(x,y);
image.draw(hole, mat, ct, "erase");

Now what im trying to do is scale the size of the circle depending on a certain variable but no matter what I try the scale doesn't seem to change and. The size seems to stay the same as I drew it in Flash. I tried adding the following line

hole.width = hole.height = size;

I even created a class file called Hole and the size as a parameter

var hole = new Hole(200);

This didn't work either it still appeared to have the same size. I have even tried altering the scaleX and Y values with no success.

View 2 Replies

ActionScript 3.0 :: Slow Performance With Bitmap Erasing?

Nov 26, 2008

for the past couple of weeks I've been learning AS3, and for a school project I'm doing a remake of the popular DOS game Liero. Everything is working fine, I got a layer of dirt that I am shooting away, but the problem is that after a few hundred bullets, the game starts to lag heavily whenever a shot is fired.I'm using a simple bitmap and a brush to erase the parts where the bullets hit.

// Drawing stage
bmap = new BitmapData(1100,800, true, 0);
dispBmp = new Bitmap(bmap);

[code]...

View 1 Replies

ActionScript 3.0 :: Input A Variable At A Specific Portion Of The Text?

Feb 29, 2012

I have a string of text, but within this text I want to input a variable at a specific portion of the text. Now this string of text is taken from an XML file. So the XML file would look like this for example:

Code:
<name>Sweep</name>
<type>ATK</type>
<target>AoE-EN</target>
<caste>Warrior</caste>
<desc>"This is a text"+temp.alias+"hey"</desc>

The <desc> is an example of a way I tried to make it work. What I want to happen is when I display the desc in my flash file, it inputs the alias (which in the xml is the name) of the item. In PHP this could be doing using EVAL() but I notice the support for that type of function is removed in AS3.

View 10 Replies

ActionScript 3.0 :: Possible In Flash To Get Specific Frame In Flv Video As Bitmap / Image?

Aug 6, 2010

Is it possible in flash to get a specific frame in a flv video as a bitmap or an image.?

i saw an example of it online but as the comments said it didnt work and some said that its not possible.

View 4 Replies

ActionScript 3.0 :: Flash Selecting A Specific Child By Mouseclick, Turning Off A Child Within All Non Selected?

Mar 19, 2011

I've used this site as a resource leading up to this, not particularly sure if I worded this correctly I have a class "Block" which is just a square (will be something else later on in the process) I want each block to have controls to add an additional block in either direction so I have another class BlockButtons which has my buttons for each direction.

And another class GlobalVar where I keep all my variables for funsies

[Code]...

View 1 Replies

ActionScript 3.0 :: Calling Function When Specific Input Text Fields Are Selected?

Dec 10, 2011

I have a number of  input text field on stage. I want to call certain function when specific input text fields are selected.

View 2 Replies

Actionscript 3 :: Flash: Erasing Area Dynamically?

Mar 27, 2012

flash: Erasing area dynamically?

View 2 Replies

Flash :: Can't Load A Portion Of An MP3

Feb 13, 2010

The problem is not playing part of an mp3, I know that can be done. But I'd like to cut down on bandwidth by loading a specified two-minute portion of each mp3. These files can be up to 20mb, and since users will play many of these songs (and probably move on after a minute or two of listening), it would be very inefficient to load the whole mp3. Can this be done or is there another method you can suggest? Possibly a server side script that slices and/or lowers the mp3's bitrate?

View 2 Replies

Flash :: Professional - Slideshow Working On A Portion Of The Site

Feb 4, 2011

I have created two photo slideshows to put on a site I'm working on. One is on the home page and it seems to work fine. The second is on another page. This one is not working for some reason. I published it in the same way I did the first from Flash Professional. When I post the slide show on the home page it works. When I take the slidshow from the homepage and put it on the second it does not work.

View 1 Replies

.net :: Programmatically Extract The Sound Portion Of A Flash SWF File?

Mar 12, 2010

Do any libraries exist with this functionality?

View 2 Replies

ActionScript 2.0 :: Bitmap Data - Place Smoke Effect At Specific Place

Feb 1, 2011

How to make this smoke effect work without mouse input. I am trying to have it spill from the end of a cannon, & my attempts to modify the position have resulted in all my bitmaps shifting. I changed this
doTrail(_root, _xmouse, _ymouse, currentBitmap);
To this
doTrail(_root, _x=80, _y=100, currentBitmap);
[Code] .....

View 0 Replies

Actionscript 3 :: Erasing A Movieclip?

Oct 14, 2010

I have a fully working flash application, made in as3. Now i dynamicly added a movieclip and i would like to be able to erase that movieclip with a eraser of some sort, my goal is to be able pick up a sponge with the mouse and then start dragging over the movieclip and erasing the parts where i dragged over it.

View 2 Replies

ActionScript 1/2 :: SOS: Change Color Of Selected Menu Item Button If Selected

May 19, 2010

I have a menu with many sub menus. I need to change the color of the selected button and then move on to the sub menu. My menu is horizontal and now it's not obvious the path that you follow.

View 2 Replies

Flex :: Disable Selected Columns In A Datagrid In It For Selected Rows?

Nov 6, 2009

Is there any way to disable a few columns for a particular row in flex datagrid?

I have a datagrid with about 10 or more columns, say for example a few column names are: Item Id, Item Name, Item Status and VerifiedState. Initially I want the column Verified State to be disabled.

Now When the value of the column, Item Status is Review Passed for a particular row, I want the column VerifiedState to be enabled and editable. Is that possible in Flex datagrid.

View 2 Replies

ActionScript 3.0 :: Erasing Drawing From Stage?

Jan 12, 2010

I tried to erase whatever was drawn on the stage by using a similar function in a recent previous post but I'm not getting it.when I try to use it an error says that this is no longer supported. I tried addChildAt() and inserted different Num but it only erased everything including my button.the current code is:
 
var drawing:Boolean = false; 
this.graphics.lineStyle(5,0x000000);this.graphics.moveTo(mouseX,mouseY);
this.addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown, false,0,true);stage.addEventListener(MouseEvent.MOUSE_UP, onUp, false,0,true);

[code]....

View 2 Replies

Flex - Erasing Components On Canvas?

Oct 6, 2010

The problem is when background of top or below label is changed, the top or below button is erased.

<mx:Canvas width="100%" height="100%">
<mx:LinkButton icon="{icon1}" width="25" x="10" y="10"/>
<mx:LinkButton icon="{icon2}" width="25" x="10" y="100" />
<s:VGroup width="100%" height="100%" id="lst" click="highlight(event.target as Label)" gap="0">
<s:Label />

[Code]...

So do anyone know the possible solution for this problem?

View 1 Replies

Actionscript 3 :: Erasing A Layer Where Mouse Is Over It?

Jul 18, 2011

I got the following question.

i added the following elements to the stage:

homeBg = new HomeBg();
homeMask = new HomeDrawBg();
addChild(homeBg);
addChild(homeMask);

I allready instantiated them in the beginning of the document. But my problem is the following. the homeBg layer is a image, the homeMask layer is the same image but it has a pencil scetch look. What i want is that wherever i move my mouse, the homemask layer should be erased so the bottom layer becomes visible(only where the mask is erased). So how can i tell the mask layer to erase itself if the mouse is over it?

View 2 Replies

IDE :: Erasing Text Effect Masks?

Feb 25, 2009

I'm attempting to create a dry erase board style animation effect in my flash movie where I'm erasing the text, like a dry erase board type effect. I've tried doing a frame by frame mask animation and it's not turning out very well. Has anyone attempted this before? Are there any tutorials or maybe after effects > flash tricks?

View 2 Replies

ActionScript 2.0 :: Blendmode - Erasing One MovieClip From Another

Nov 10, 2009

I am trying to erase one movieclip from another using the blendmode="erase" setting, but can only get it to work on the stage as the parent. This means it erases a hole through everything! The attachmovie also doesn't seem to work as I was expecting and I was hoping that when you drag the movieclip, the attached clip would move with it? If you check out the FLA [URL] you can see whats happening right now and what I want to achieve (diagrams provided in FLA).

View 1 Replies

ActionScript 2.0 :: Erasing Lines Drawn With Root?

Aug 20, 2009

How can I erase lines I've drawn using
_root.lineStyle()
_root.moveTo()
And
_root.lineTo

View 1 Replies

Flash 10 :: Export Specific Frames Not All Frame - Specific Timeline

Sep 15, 2010

how do i export specific frames not all frame. ex: if flash has 1 to 200 frames. here i want to export 51 to 150 frames as a movie. if there is any command or plugin to export movie like this.

View 0 Replies

ActionScript 3.0 :: Pixel Have Changed To Get The Percentage Of The Complete Erasing?

Feb 2, 2010

I'm working with Threshold on BitmapData class. I need the threshold return the modified pixel (the pixels match with the equation).I need to detect how many pixel have changed  to get the percentage of the complete erasing! I did it with getPixel32/setPixel32 but it's faster with threshold (i'm doing it on 15 bitmapdata at the same time)

pixelChanged += bmp.bitmapData.threshold(bmpBrush, bmpBrush.rect, new Point(this.stage.mouseX, this.stage.mouseY), ">", 0);
 
so, each pixel bigger than 0 should match this equation ... and they will be set to 0 after that (default color value). Next time, because they are 0, pixels are not suppose to change again because 0 is not bigger than 0 ! But it still return me a value, like if the pixel have changed! I've tried with different combinaison of mask/threshold .I join a sample of my problem (drag the triangle and check the output window ... the number increase even if the pixel is transparent 0x00000000)

View 1 Replies

ActionScript 3.0 :: Coloring (or Erasing) An Object And Checking When Complete

Jul 21, 2011

I've got to build a kids game at the moment for my school, and I was planning to have a sort of archaeological dig, with the kids required to rub the screen (it's for a touch-screen) to "un-earth" the bones underneath.I was thinking of either erasing an overlay and checking for a hitTest between the two objects, or coloring in with a line or something.Is it possible to color something in and check when the object has been completely colored? or possible to erase an overlying object? and if so, can you point me in the direction of a tutorial or a quick explanation?

View 2 Replies

ActionScript 2.0 :: DragOver - Drawing White Line By Erasing Dots

May 19, 2010

I have the raster of dots on white background. I would like it when I DragOver each dot it becomes white so it looks like you are actually drawing white line by erasing the dots. Ive somehow found the way how to do it by making it transparent when I rollover. But it doesnt work with dragover. How to do it only when I hold down the mouse button and drag my mouse over the dots?

This is the script assigned to MC with one black dot (I copied this MC with one dot into another MC and multiplied it to have the raster):
this.onRollOver = function () {
this._alpha = 0;
} this.onPress = function () {
this._alpha = 50;
}

I've tried also this, but it doesn't work:
var erasepoint = false;
this.onMouseDown = function(){erasepoint = true;}
this.onMouseUp = function(){erasepoint = false;}
this.onRollOver = function () {
if(erasepoint){
this._alpha = 0;
}}

View 6 Replies

Flash :: Use The CS4 Tool's On A Bitmap Image After Tracing The Bitmap Image And Applying My Settings?

Aug 7, 2009

Use the flash CS4 tool's on a bitmap image after tracing the bitmap image and applying my settings?

View 10 Replies

ActionScript 2.0 :: Difference Between RemoveMovieClip() And UnloadMovie() For Use In Erasing Duplicated Movie Clips?

Sep 21, 2006

What (if any) is the actual differance between removeMovieClip() and unloadMovie() for use in erasing duplicated movie clips (using duplicateMovieClip() )? I was looking over some of my code and noticed I used both without much rhyme or reason as to why one over the other.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved