ActionScript 3.0 :: Moment Of Brainfreeze - BitmapData With A Alpha Mask?
Mar 15, 2011
If my title ain't clear enough, I've got two bitmapData sheets with an image, one being the actual image, and the other image having the same structure, but all areas being visible are black, and all transparent areas being completely white. So far I've been playing around with:
[Code]....
View 5 Replies
Similar Posts:
Sep 10, 2010
I have a startDrag function set up on a loader and mask that when the mouse is down on the loader it drags, when not it doesn't. There is also 2 buttons that control whether mask1 or mask2 is used. What i would like however is when the mouse is down - the area of the loader outside of the mask is visible but only by about 10/20% alpha, that way the user can see where all the image is while dragging. Is this possible? Full code can be seen below and i have attached the zip with the .fla file:
[Code]...
View 2 Replies
Feb 5, 2008
[URL]
I am using a .flv player. When I run it in my localhost then it runs properly, but after uploaded on the my dedicated server and let it run in my browser, only the menu apears and de video itself is missing..
It all worked a few days earlyer -so why did it disapear?
I used Flash CS3 and actionscript 2.0 It's compleaty in Dutch.. I didn't make the asignments -don't flame me. I know it's low-tech.
View 3 Replies
Sep 15, 2010
I have a BitmapData object created dynamically that contains user-drawn shapes. I then attach that BitmapData object to a MovieClip via a Bitmap object and set that MovieClip as a mask to another MovieClip. The mask works but the whole bounding rectangle of the BitmapData is acting as the mask. But I want to exclude the transparent portion from the mask so only user-drawn shape can be set as mask. Can anyone tell how to achieve that?
View 3 Replies
Jan 11, 2010
I'm blitting a map onto the screen with tiles.. and the source of these tiles are BitmapData objects.I know you can change the alpha of a bitmap.. but I'm not too sure if it can be done on the BitmapData object itself.I want some tiles to have less alpha than others. Applying the alpha to the Bitmap.. makes everything on the current screen have an alpha.. but I only need one tile of it..
View 4 Replies
Aug 30, 2011
I'm trying to copy the bitmapdata of a movieclip in which i have a mask. And it copies by ignoring the mask. It's there a way to make it copy what i see (including the mask applied)?
View 7 Replies
May 17, 2011
I am looking for the most efficient way to create a circle mask on a BitmapData, so that everything inside the circle is visible and everything outside the circle is black. Here is my current code:
[Code]...
As the radius of this circle is going to be changing rapidly, storing the mask would be useless. how to make this more efficient, preferably keeping to methods that can use GPU accleration?
View 0 Replies
Feb 26, 2008
What I have setup right now is one movieClip that is being used to be drawn into a BitmapData object. That bitmapData object is being drawn on the enterFrame and I am needing to clear it so it doesnt have the previous enterFrames information still stored in it, then once it is clear draw the current information. Is there a simple way to clear or erase all the pixel information in the BitmapData object?
If there is a way to set the alpha of the pixels I would really like to know how that is done as well. However, I want to change the alpha level of the entire BitmapData object, not just a few pixels.
View 2 Replies
Jan 19, 2011
I have a movieclip with an image that has transparency and filters applied to the movieclip.I know I can use "draw" to copy the movieclip to a bitmapdata object, but it doesn't seem to copy the filters and the transparency of the image. How can I copy these so the bitmapdata matches the original movieclip in appearance?
View 5 Replies
Aug 22, 2011
i have the following situation:
one drawing layer (graphics object with lineTo, etc.)
one png with an alpha channel (supposed to serve only as a mask)
now i want to be able to only draw lines within an area restricted by the png mask.
i am trying like this:
var bitmapData:BitmapData = new BitmapData( 320, 320 );
bitmapData.draw( drawingLayer );
bitmapData.copyChannel( maskBitmapData, new Rectangle( 0, 0, 320, 320 ), new Point( 0, 0 ), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA );
now the borders get cut off fine, but i get a black background, since the drawing layer has an alpha between the drawn lines (and it should remain like this) and the mask bitmap has an alpha outside the shape. so naturally the mask's alpha replaces the drawing layer's.
i tried it with merge, copyPixels and also with just setting the mask property on the drawing layer (i set everything to cacheAsBitmap) but to no avail.
ADDITION:
when trying to use a mask i tried it with
<s:BitmapImage id="mask" source="@Embed(source='...')" cacheAsBitmap="true" />
and also as
[Embed("...")]
private const BodyMask:Class;
var maskBitmap:Bitmap = new BodyMask();
and assigned them to the mask property of a s:Group element (cacheAsBitmap=true) where the operations on the graphics object occured. i also tried reassigning the mask after each draw operation.
View 1 Replies
Apr 14, 2009
I have run into strange behavior drawing a sprite into a BitmapData. This sprite looks fine when drawn directly to the screen. But when this sprite is drawn into a BitmapData, the sprite is being masked... but there is no such mask applied to that sprite! This "bad mask" can be toggled off and on... by applying / not-applying a different mask to the sprite I am drawing. This mask is not the same shape or location as the "bad mask".
[Code]...
View 1 Replies
Jan 28, 2009
I am running into trouble getting an alpha mask to work correctly in AS3. The mask itself seems to be working on the pixelated movieclip, but the alpha channel isn't appearing at all.
View 4 Replies
Aug 19, 2009
I've used this code to apply a gradient alpha mask: bg_mc.cacheAsBitmap=true;mask_mc.cacheAsBitmap=true;bg_mc.setMask(mask_mc); Then I applied a motion tween to the mask_mc clip. But the motion tween doesn't happen? It only shows the first frame of the motion tween. It does apply the alpha mask though. Why doesn't it show the rest of the motion tween.
View 9 Replies
Aug 19, 2009
I've tried to make an alpha mask using a photo and a mask containing a alpha gradient. Using this code:
ActionScript Code:
maskee.cacheAsBitmap = true;
maskMC.cacheAsBitmap = true;
maskee.setMask("maskMC");
But it's not working? The 'blob' mask in the center should motion tween bigger. I can see the alpha mask in action, but the motion tween doesn't do anything. The image is freezing.
View 6 Replies
Oct 14, 2010
I'm looking for the most efficient possible way of drawing an 8 x 4 grid (960x600 total size). Each square of the grid has a variable alpha and the grid is redrawn every enter frame. The problem is my application is doing a lot already and I'm looking for the most efficient way to execute this loop 32 times (possible more in fact) per frame without overloading processor.
Code:
private function init():void {
var dimensions : Array = [ 0, 0, 960, 600 ];
var gridRaw : Array = [ 8, 4 ];
var stageRect : Rectangle = new Rectangle( Number( dimensions[0] ), Number( dimensions[1] ), Number( dimensions[2] ), Number( dimensions[3] ) );
[Code] .....
I'm under the impression there could be better ways of drawing the shapes straight to BitmapData without using Sprites, or maybe I'm doing something wrong about memory usage as I can see memory going up and down in a cycle.
View 5 Replies
Mar 17, 2011
I am drawing a flash sprite on a BitmapData using its draw() method. This sprite has some nested objects with 0 alpha, yet the draw() method draws them on the bitmap data.
I think it has to do with the color transform I am using, but I have no idea how to change it to achieve the effect I want.
The color transform is the following:
Code:
new ColorTransform(1, 1, 1, 1, 255, 255, 255, 255);
I am using these values in order for the Bitmap to have white pixels wherever the object was, and black where there is nothing. The draw() also draws my alpha = 0 objects in white as well.
View 1 Replies
Jul 9, 2011
I would like to make a mask that both converts any colors to grayscale and then reduces their alpha value. The intended purpose is for the masked region to be in grayscale and lighter so that the unmasked region is more prominent. Most tutorials I've seen for alpha value masks are far too complicated and use the Flash GUI. How do you accomplish the same thing in ActionScript?
If the following is my image:
Then a traditional mask over some selection would produce the following:Instead, those parts that are masked out completely, I would like for those to be converted to grayscale:And their alpha value decreased, so they're lightened:
View 1 Replies
Jul 18, 2006
Is there anyway to create an alpha mask out of a grayscale image in flash?i am using the color adjust filter to create a bleached out kind of image. I would like to make the white transparent.
View 1 Replies
Mar 6, 2012
I'm making a side-scrolling game, with a (theoretically) infinite background. I have a block engine that places the blocks on the bitmap canvas. Now here's the catch. I'm using the bitmapData.scroll() function. Now unless I clear the screen each time the character moves, it's going to leave ghost images of the border of the screen, like this picture: zanzlanz. tumblr. com/post/18857712784 If I clear the screen each time, then it generates a lot of lag (because it has to repaint the objects again). I'm a bit lost on how I can scroll without leaving streaks of the side of the screen and without repainting the entire screen.
View 1 Replies
Jul 30, 2010
I'm trying to calculate the scale value of my MCs to make them fit perfectly the stage horizontal space.I'm using this function:
ActionScript Code:
var tableNow:Array = table.getTableCards();
var newW:uint, scaleVal:uint, startAddingTableFrom:uint;
[code].....
View 0 Replies
Jan 31, 2007
I'm using Flash 8, with this code in the first frame:
import flash.display.BitmapData;
rissa._x=Stage.width/2;
rissa._y=Stage.height/2;[code].....
When I publish the file, I'm getting the following error message in the Output panel:
**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 7: The class or interface 'BitmapData.loadBitmap' could not be loaded.
var plaid:BitmapData.loadBitmap("plaid");
Total ActionScript Errors: 1 Reported Errors: 1
View 8 Replies
Oct 14, 2009
I am trying to use the reflect class from "http://pixelfumes.blogspot.com/2007/03/reflection-class-v3-with-source .html" but I keep getting this error:
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData()
at Reflect()
at Site_fla::GalleryPage_29/loadThumbs()
at Site_fla::GalleryPage_29/sortXML()
[Code]...
btw, first I used assigned thumbContainer as the mc argument (outside the loadThumbs() function) and it worked but not exactly what I wanted... because I thought it is supposed to update when the movieclip is animated but it actually didn't... when I use a scroller, only the thumbs that are first loaded to the stage get the reflection..
View 10 Replies
Dec 29, 2011
I've been using BitmapData.copyPixels() to draw graphics onto a canvas (Bitmap).I need to rotate the resulting graphics without the use of draw() because it's vastly slower.How can I rotate the target graphic? I'm assuming that there might be a formula or library that I can use which will first reorganize the pixels that make up a graphic based on an origin (point) and radians.I'm pretty certain that I'm not capable of creating such logic, so if there are any known libraries that do this, that would be awesome.I'd like to achieve something similar to XNA's SpriteBatch.Draw() method, which accepts rotation as its 5th argument.
View 3 Replies
Jun 23, 2010
i'm having a sound looping issue at the moment on my site. I'm trying to make it so i have sparks shooting out of something, and at the same time the sparks shoot out i have a electric type sound. BUT the graphics all seem to work, but the sound for some reason, just keeps looping even when i'm not moused over. I put stops for the sound all over the place on like every frame and still doesn't work. Is there a bit of code I can use somewhere that will just mute the stupid thing after you take your mouse off the button?
here you can see what i'm talking about. I don't have it on loop. [URL].. the way i'm getting this animation to work, is by having one big movie clip and inside that movie clip i have the sparks movie clip, and the blue fade movie clip, then i just dropped in the sound where the sparks movie clip is.
View 1 Replies
Feb 11, 2012
I want to take a screenshot from my website of another website or preferable 1 part of it (an object tag).I want it to work this way: I click on a button that will send a request to screenshot the page at this moment. Several ideas are insert the page inside a flash object and screenshot it. Or opening a browser on the server and when I click the button send a request using AJAX to tell the server to screenshot with this browser.How should I do this because I kind of failing right now with the flash Idea. The page I am trying to screenshot is a live camera that uses a .wvx object. But I can't even do that with a .swf object
View 1 Replies
Apr 29, 2004
I'm working on a XML update modulle, but i have a big problem with my insertBefore I'm just trying to add an <xxx> tag before the <newsItem> tag for the moment, He only does inserts it befor the first <newsItem> tag, he refuses to do it before the 2nd, 3rd or 4th newsItem tag This is the XML code (for a better view [URL] )
[Code]...
View 1 Replies
Mar 20, 2006
I want to rotate the image in flash. kind of 3d moment
View 5 Replies
Sep 1, 2011
how to use the bitmapData collision method. Now I'm trying to figure out if there is a way to see at what angle or coordinate of the bitmapData the collision happens? I need it in order to figure the accurate bounce angle after the collision occurs.
View 2 Replies
Jul 15, 2009
I'm currently working on a flash game and I need to know how to addChild a BitmapData or draw a BitmapData to screen. If I can't than how can I give a DisplayObject my BitmapData?
View 2 Replies
Jun 11, 2009
I'm using:this.flipQ1One.visible = false; and this.flipQ1One.visible = true; to hide and show a movie clip, the problem is that the movie clip is an object that flips then stops and by the time is shown (when the condition is complied) the flip had already happen while hide so you don't see it.What I need is that the movie clip starts playing at the moment the "visible" becomes true not before.
View 5 Replies