ActionScript 3.0 :: Changing Alpha Of A BitmapData?

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


Similar Posts:


ActionScript 2.0 :: BitmapData Clear Pixels Or Set Alpha

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

ActionScript 3.0 :: Copy A MovieClip With Filters And Alpha To Bitmapdata?

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

Actionscript 3 :: Merging Two Bitmapdata Objects' Alpha Channels?

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

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

ActionScript 3.0 :: Flash Most Efficient BitmapData Grid Drawing With Alpha

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

ActionScript 3.0 :: BitmapData's Draw() Method Also Draws Objects With 0 Alpha

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

IDE :: Changing The BitmapData.rectangle - X And Y Locations

May 2, 2009

I'm trying to take a 'snapshot' of a movieclip that i've got on the stage with "BitmapData" and then starting a "draw()" command on it. I'm able to get it drawing.. however.. it only takes the things from (0,0).( the upper left corner of the movieclip. Doing a trace on "BitmapData.rectangle" gives me it's X and Y coordinates .. and it's width and height..

How do I change the X and Y locations of the BitmapData for it to start the drawing from? As I have some stuff on the negative side of x.

View 1 Replies

ActionScript 3.0 :: Changing Opacity Of A BitmapData

Apr 12, 2011

I am trying to create a Photo Editor using Flash One of its features is to change the Opacity of the Image. Now my problem is how to change the Opacity of a bitmapData and save the image so that the resultant image has a changed Opacity.

View 2 Replies

ActionScript 3.0 :: Changing The Alpha Of A Swf

Aug 10, 2010

I'm trying to create a tab system on my website. I have a small 25 pixel tall swf file at the top of the page that acts as the tabs. It uses PHP to communicate with the rest of the site. I have a larger swf below that acts as a directory to my files. When the user finds a file, he or she can open it in a new tab by clicking a certain button. And then switch between tabs using the top swf. I've got all of this down using AS3, but I'm not as good at the basic web design elements. How do I communicate to have every lower layer except for the one that the viewer wants to look at go to 0% alpha? Also, I cannot just have the tab system be all in one swf because some of the files that I want the user to open will be in AS2, which won't run inside an AS3 host.

View 3 Replies

Actionscript 3 :: Changing Alpha Of A MC On Hover?

Apr 11, 2011

this.addEventListener(MouseEvent.MOUSE_OVER,function() {
this.alpha=0
})

In an MC, I want it to become invisible when the mouse hovers over it. The reason I'm putting this code inside the MC and not making an instance out of it is because this MC will recur numerous times. The listener does work, as tested with trace(). For whatever reason, alpha doesn't.

View 1 Replies

ActionScript 2.0 :: Changing The Alpha Of A M.c. With A Slider?

Jun 21, 2005

I have been checking out the following tutorial:on how to adjust the volume with a slider.it's great!what I'd like to do is use that same slider to adjust the alphaof a movie clip.is that possible?or maybe adjust the alpha of a symbol.what i'm trying to do is create "mood lighting"where the user can move a slider and lighten or darken an interiorspace, by adjusting the alpha of a dark square on top of the scene.

View 3 Replies

ActionScript 2.0 :: Changing Alpha Settings?

Apr 28, 2003

i made text into a movie clip and put in this code to adjust the alpha.

onClipEvent (load){
this._alpha=100;
i=1;
}
onClipEvent (enterFrame) {
if(this._alpha=0 && i==0){

[Code]...

The alpha is going down.I think, because the text isnt there. What i'm having trouble with is getting it to go back and forth. Increasing and decreasing the alpha when it gets to it's maximum or minimum. I hope I'm making some sense.Does anyone have any ideas? And no I cannot do this with a simple motion tween because there are things happening in the background.

View 3 Replies

ActionScript 2.0 :: Changing Alpha In A While/for Loop?

Nov 3, 2009

i'm trying to get it so a MC1 on top of MC2 slowly fades in. It starts with alpha of 0 and i put it in a while loop (on MC1):

onClipEvent(load) {
this._alpha = 0;
var i = 0;

[code]....

View 2 Replies

ActionScript 3.0 :: Dynamically Changing Color Of MC - Using Alpha?

Mar 8, 2009

I am changing colors of an mc dynamically, in this way: I have an mc of the color green for example. What I want is it to turn to a specific color in time. I have in that mc a sprite, that is that specific color (red in this case). iIset it's alpha to 0 and put it in the layer above the green part. Now when I set its alpha to 1, it will be that colour. When I set it to 0.5 ofcourse it'll be a mix between those colours. Is it faster to do it, but changing 0xFFFFFF? I wouldn't know how to do it though. i want to be able to tell it to go 3/4 of color nr 1 and 1/4 of color nr 2, for example. i also want to be able to choose those colours specificly, for the sake of art. so just choosing 0xFF0000 for red, wont do, for artistic reasons.

View 3 Replies

ActionScript 2.0 :: Changing Alpha From A Different Movie Clip?

Apr 6, 2010

The thing should work like this: theres a movie clip in frame 10 of the timeline with two buttons inside, by clicking one of them the movie should jump to frame 15 and take the alpha of two Mc there (they are inside a different movie clip) to 0. This is what ie been trying (code on the button, btw):

on (release) {
McScene2.lettuce._alpha = 0;
McScene2.pumpkin._alpha = 0;

[code].....

View 9 Replies

ActionScript 3.0 :: Changing Mc Alpha That's Inside A Button?

Jan 28, 2012

i really can't belive i'm asking this, but i've been about an hour trying to look after a solution for this but I couldnt find nothing. i'm trying to change a movieclip's alpha when the swf loads and when I press an existing button. the problem is that that movieclip is inside a button and as3 has a problem with it.

this is what i am trying to do in the first frame of the first scene.

[Code]...

View 1 Replies

ActionScript 2.0 :: Make Menu Alpha Changing?

Jul 28, 2004

I have a menu inside a MC, and Id like to make s alpha = 50% when some button is clicked ,but when the mouse is over it, s alpha changes back to 100%.

View 1 Replies

ActionScript 2.0 :: Changing Alpha On Multiple Movie Clips?

Jan 7, 2010

I know how to change the alpha of one movie clip at a time on rollover, rollout, and release. But I'm a bit stuck trying to figure out how I would change the alpha of multiple movie clips, when one is clicked. It's for a simple photo gallery and I want all the thumbnails to darken once one has been clicked & the image is loading. I can't just fake it by having a somewhat transparent black movie clip appear over everything, because I need the alpha of each thumbnail to be able to change again once people roll over a new thumbnail.(a section of my code is included for reference but there are like 30 thumbnails so I didn't include it all, the code is the same for everything)

Code:

thumb_001.onRollOver = over;
thumb_001.onPress = down;
thumb_001.onRollOut = out;
thumb_001.onRelease () {

[code]....

View 2 Replies

ActionScript 3.0 :: Saving Alpha Property When Changing Frames

Mar 22, 2010

i have this little display and when you click on certain items their alpha changes to 0.1, this worked fine until i added another frame with a different display on another frame. so now when you change frames and go to the new display then go back to the old display on frame 1 the alpha properties are all reset back to 1. So to fix this i thought i could simply add all the movieclips with an alpha less than one to an array when i left the frame then when you come back to the frame you could reset all the moviclips in that array back to having an alpha of 0.1. But this doesnt seem to work. here is the code i used.[code]But this code doesnt seem to work, the strange thing is even when i add some trace statements they tell me that the alpha does in fact equal 0.1 but visibally they haven't changed.

View 2 Replies

ActionScript 3.0 :: Changing Alpha Of Object - How To Define Property

Aug 15, 2009

I am very new to Flash and I have the following script:
mouseInterval = setInterval(changeAlpha,10);
function changeAlpha(){ fader_mc.alpha = Math.round(root.mouseX/550*100) }
This is simply to change the Alpha of my object as I change the X value of the mouse cursor. I keep getting the following error message:
1120: Access of undefined property mouseInterval

View 5 Replies

Actionscript 3 :: Memory Gain Changing Alpha Value Of An Object?

Dec 30, 2011

for a periodic table tool I'm making, I've incorporated an effect that changes the alpha value whenever I hover over an element (pretty standard). I've noticed a mysterious gain in memory when hovering over my elements; using SYSTEM.TOTAL_MEMORY - there would be about 0.005MB increase in memory usage when I hover over an element, which isn't relinquished when I move my mouse off. However, if I move my mouse back on again, there isn't a second memory gain.

[Code]...

Does anyone know why this memory gain is happening when the alpha value is changed? And curiously why it only happens once? Some extra info: my Element class is a MovieClip, with a couple of TextFields, primitive variables and a MovieClip in it. It has had its mouseChildren property set to false (and buttonMode property set to true).

View 1 Replies

Changing Alpha Of Movie Clip On Button Rollover

May 15, 2009

how to increase the alpha of a movie clip when you rollover a button.

View 1 Replies

ActionScript 2.0 :: Finite Menu - Changing / Increasing Alpha

May 9, 2005

I have created a finite menu and it works fine, the only problem is that now I want to have the menu set to 50% alpha and when the user moves the mouse over the menu it gradually increases to 100%, Since I have never messed with Alpha's using action script.

View 14 Replies

Professional :: Gradual Image Fading Via Changing Alpha Values?

Dec 18, 2010

I'm doing this via the motion editor.  But, is it possible to fade an image gradully from left to right instead of the whole image at once?

View 8 Replies

ActionScript 3.0 :: Alpha RollOver Thumbnails - Changing The Opacity Of The Button

Nov 17, 2009

another rollover question dealing with changing the opacity of the button. Anyways. after digging through the site I found this:

[Code]...

View 1 Replies

ActionScript 2.0 :: Controlling MovieClip In Presentation - Removing / Changing Alpha

Mar 29, 2007

I've been playing around with the presentation screens and slide in Flash, from browsing the web there seems to be very little if any information of how to control MC's within different parts of a presentation i.e. removing them or changing alpha. I've loaded an MC and now I'm am trying to remove it from the stage been experiment on the same slide and I just cant seem to get control of it.

I was using
_root.slide1.intromc._alpha = 0;
But this doesn't work for. How I can get access to MCs in a slide if its possible !!!!

View 1 Replies

ActionScript 3.0 :: Loading And Changing The Alpha Of An Image Via A Static Class

Dec 30, 2008

I'm trying to make a URL-Loader Class to speed up my workflow, but I can't manage to make the images I am loading visible, turning their alpha to 1.

I use the following line to invoke my custom loader:

import com.ab.utils.Load
Load.Image(menuitem.holder_mc, menuitem.image, this)

[Code]....

Notice where I call a Tweener, trying to make my mc (_ITEM)'s alpha turn 1.

I tried thing like loader.content and loader.content.holder_mc, but to no avail.

View 2 Replies

ActionScript 3.0 :: BitmapData Alpha Scrolling - Without Leaving Streaks Of The Side Of The Screen And Without Repainting The Entire Screen

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

ActionScript 3.0 :: Draws A Couple Of Lines With Changing Alpha And Width Whenever The Mouse Is Moved?

Apr 23, 2009

I have wrtitten some code that draws a couple of lines with changing alpha and width whenever the mouse is moved. I need to convert this code to AS3 so that I can use it in conjunction with some video tracking.

Code:

var speed:Number = 100;
var myNumber:Number;
var myMax:Number = 50;[code]...

View 1 Replies







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