ActionScript 3 :: Blending Objects With Each Other But Not With Background

Jul 21, 2011

I have a number of objects (represented as DisplayObjects) that I wish to blend with each other. However behind these objects there is a background that i do not want to involve in the blending. So basically I want to blend these objects with eachother and afterwards use the result of this blending as a new DisplayObject (for example to put it on top of a randomly colored background).

So what I have is:
var obj1:DisplayObject = getFirstObj();
var obj2:DisplayObject = getSecObj();
var background:DisplayObject = getBackground();
obj1.blendMode = BlendMode.ADD;
obj2.blendMode = BlendMode.ADD;

At first attempt I tried was putting these objects into a common DisplayObjectContainer hoping that blending mode would only be relative to all objects contained by the same DisplayObjectContainer, but this does not seem to be the case.
var objectsPool:Sprite = new Sprite();
objectsPool.addChild( obj1 );
objectsPool.addChild( obj2 );
addChild( background );
addchild( objectsPool );

View 2 Replies


Similar Posts:


IDE :: Does Flash Have A Way Of Isolating The Selected Blending Mode To Just The Layers Or Objects

Mar 25, 2009

I'm new to the whole flash thing and I'm learning on flash 8 - In photoshop you can group layers so that the blending mode you use on a layer will only apply to the layers in that group... I've been searching all over, and maybe it's right in front of me, but does flash have a way of isolating the selected blending mode to just the layers or objects of the user's choice?

View 6 Replies

ActionScript 3.0 :: Pass Through Blending Modes?

May 5, 2010

I'm finding a lot of problems trying to do a large-scale and complex 3D interface, and most movieclips are parented once if not several times. This is the only way that I see to be able to manage having a number of movieclips move and rotate together with common anchor points. But one of the problems with this is not being able to set different blendModes of child clips. Yes, yes, I usually try and avoid parenting for that reason which is much easier in 2D. But if there is no way to "force" or "pass-through" blendingModes of clips with parent(s), please explain to me how I can have a number of button objects that I can easily move and rotate together around 3D space, but also have independently changeable blendModes for rollover states etc?

View 0 Replies

ActionScript 2.0 :: Blending On/off Sound Button Together?

Apr 17, 2011

ActionScript Code:
on (release) {
tellTarget ("../music") {
stopAllSounds();
}
}
on (release) {

[Code]...

How do you make that into one script so the on button is the same as the off?

View 9 Replies

ActionScript 2.0 :: [Flash] Blending/Fading Movieclips?

Sep 23, 2009

Below I have actionscript that plays movieclips in my library at random. How can I add to this to blend(fade) the movieclips into each other so that when the movieclip is done, it doesnt fade to white it simply fades/blends into the next movieclip/slide?

Code:
var MCs = new Array("mc1", "mc2", "mc3", "mc4", "mc5");
var selectedMC = MCs[Math.floor(Math.random() * MCs.length)];

[code].....

View 1 Replies

Professional :: Import PNG Sequence And Apply Blending Mode To It?

Mar 20, 2010

How i can import PNG sequence and apply blending mode to it? i import PNG sequence in timeline but it have 120 frames,if i want apply bleding mode to it, i have to apply 120 frames.it's not logical.

View 2 Replies

ActionScript 3.0 :: How To Stop Blending / Smoothing On Edges Of Sprites

Nov 21, 2011

When I draw a perfectly rectangular sprite, where all the corners land on perfect integer locations, then there is no problem. However when my sprite as an irregular shape ( with diagonal lines ), or it does not land on perfect integer locations, then Flash does some kind of blending / smoothing around the edges. This is bad.

Here is an example:
ActionScript Code:
var s:Shape;
s= new Shape();
s.graphics.beginFill(0x0000ff, 1);
s.graphics.moveTo(0, 0);
[Code] .....

And here is an image of what the above produces:
From the code, I drew a green rectangle and blue one, both with a slight skew. So the only 2 colors I want to see are blue and green. But you can see from the image, that along the diagonal of the shapes, there is some kind of blending going on. Flash is using a light green, and a light blue in certain places. Presumably this makes things look better, but I need to prevent this. I need each pixel to be either green or blue or nothing (white). How can I stop Flash from blending the pixels like its doing?

View 9 Replies

ActionScript 3.0 :: ColorMatrixFilter - Blending - Bitmaps - Fade Out The Pixels Each Frame And Then Add New Ones

Aug 29, 2009

Solved HERE: [URL] It's a mashup from two inspirations. Basically I'm using PV3D to add pixels to the scene everyframe and I have an BitmapEffectLayer handling their display. At the moment I am using a ColorMatrixFilter to fade out the pixels each frame and then add new ones. This is great but I also want additive blending (so when many pixels are on top of each other they turn white).

The original 2D version of this basically added the particles color to the original pixel color creating an additive blend. But I can't do that in 3D!!! Once the old pixels have been drawn they go to the BitmapEffectLayerand are rendered in 2D.. but I can go from 2D back to 3D again.. I hope I have explained my problem clearly.. also even if I could my skill doesn't permit me to do it..

View 3 Replies

ActionScript 3.0 :: Attaching Objects On Scrolling Background?

Aug 5, 2009

I have a scrolling background and am trying to place an object on top of it dynamically. I can get the object(which is a picture of a tractor to appear over the background with the following statement attachMovie("tractor_mc","pic",2); however it locates it at the wrong position on the stage. Is there anyway that I can control where the object is dynamically placed on the stage ? im using Flash 8 and ActionScript 3.0

View 0 Replies

ActionScript 3.0 :: 'Slicing' Background Image Into Useable Objects?

Mar 9, 2011

I'm looking into doing the following :

I've got this 'map.png' that i'm using as a background image. The map shows a country with all the provinces/states/counties 'outlined' on it.

I'd like to generate the effect when you mouse-over or click on a province you get info on the selected province, maybe highlight it, or its outline.

The best way to do this would be making objects/MC's on top of the image ? Slice out parts of the image ?

View 9 Replies

ActionScript 3.0 :: 24 Objects Transparency Bug - Overlap The Layer Background

Jul 13, 2011

I ran into an odd problem a week ago that I haven't been able to fix. I'm new to Flash so sorry if this has been discussed but my research has turned up nothing. I'm using Flash Develop. I managed to duplicate the problem in a simple program: I set up one large bitmap for the background, not transparent. I then add another large bitmap on top of that, the second layer background, as a child of the main bg. This layer has transparency so you can see the bg through the trees and such. Then I stack a lot of sprites on top of each other, all with transparency. They can be children of the main bg or the second layer bg, doesn't matter. Where the transparency of the sprites overlap the second layer background disappears completely to reveal the main background (like a window around the sprite stack.) The bitmaps I'm using are from embedded png files.

I found that 23 transparent objects causes the 24th object and beyond to disappear. And it only happens when I have a mask set to the main background (a simple filled square for clipping the child sprites that move off-screen.) Also the problem goes away while the background is moving. My project features many objects near each other so the chance of this problem occurring is pretty high. Its not game-breaking but I'm new to flash and my project is nearly complete (and large) so I'm hoping there is something simple I can do to fix this.

View 3 Replies

ActionScript 3 :: Draw Two Shapes On The Same Movie Clip's Graphics Avoiding Alpha Blending Between Them?

Dec 4, 2010

for example:

var mc:MovieClip=new MovieClip();
mc.graphics.beginFill(0x000000,0.5);
mc.graphics.drawRect(0,0,100,100);

[code].....

View 7 Replies

Professional :: Use The Color Effects And Blending Options Of MovieClip Square To Make Layer 1 Alpha

Aug 11, 2011

Inside movieClip container, there are colored buttons on layer1 and on layer2 there is movieClip square which covers the buttons. I want to use the color efffects and blending options of movieClip square to make layer 1 alpha. There are some blending options called alpha, difference, lighten and substract but Im not getting the right combinations. I want to make layer1 alpha only by using layer2.

View 1 Replies

ActionScript 3.0 :: Bitmapcanvas - Add Shadows To All Objects - Background Bitmap (won't Change During Level)

Oct 21, 2010

I'm working on a tile based game, inspiredb by tutorials from the book "the essential guide to flash games". Please have a look at [URL] -- edit: by the way, the game idea is by no means mine, but i want to replicate the old game "sensitive" from the c64 [URL] for learning purposes I want to add shadows to all objects that stand in the water. However, since I want to keep my sprite count to a minimum, I have put all objects that don't do anything in a background bitmap. The best solution I can think of is to have:

1) a background bitmap (won't change during level)
2) a background shadows bitmap (won't change during level)
3) a sprite layer
4) and a sprite shadow layer at every screen, but this seems like a lot of work for just shadows.

View 5 Replies

ActionScript 3.0 :: Scrolling Background Is Hidding The Birds, Planes And Clouds Objects Which Scroll Up?

Nov 9, 2011

I thought I would create a simple little game involving a skydiver who is supposed to be falling towards the ground, the problem I have got is the scrolling background is hidding the birds, planes and clouds objects which scroll up,

package
{
import flash.display.MovieClip;[code]......

View 2 Replies

Javascript :: Video With Transparent Background On Page Above Image Background?

May 2, 2010

I want to embed some video into my HTML page. As background I want to use big picture. And above it I want to insert loop video with (i.e.) walking man.So, can I embed video (without flash and any player controls) in page?Can I decode video with transparent background? Is there any codecs which support transparent background (alpha-channel)?

View 1 Replies

Flex :: After Importing A PNG With Transparent Background It Shows Up With White Background

Dec 28, 2010

As the title already states i have a (big) problem importing a PNG in a Flex 4 application.Created a PNG file in Photoshop with transparent background. Loaded in Flex application using this code:[code]So when the complete event fires the data has been loaded and it is possible to assign the data loaded to the image component named Thumbnail:[code]Unitls now everything works as expected!But when i try to send the Thumbnail component's data to a WCF service i receive a photo with white background:[code]

View 2 Replies

CS3 - Make Background Flash Background Transparent In Dreamweaver?

Apr 10, 2009

I've designed a Flash site in CS3 using Action Script 2.0 that has a main flash movie sorta floating in space over a gradient background. I want the gradient background to re-size with the browser, so I thought that the easiest way to do this would be to delete the gradient background in Flash and instead recreate the background in Dreamweaver using the repeat background option and then make the Flash movie's background transparent. (I hope I'm making some amount of sense here).

I've found a few tutorials on how to do this, but so far I just get a white background instead of transparent. I've tried choosing "Transparent - Windowless" under Window Mode on the HTML tab in Publish Settings. And I've tried selecting the movie from within DW and clicking the parameter button and adding a "wmode" parameter with "transparent" as its value.

View 2 Replies

ActionScript 3.0 :: Printing A MC With White Background, Not Stage Background?

Dec 10, 2008

trying to print a movieclip with a white backgroundwhile keeping the stage background black.The movieclip,printResults_mc has a white rectangle in the bottom layer, 850pixels x 1100 pixels. The following function scales printResults_mcto the printers printable area but because isimpossible to predict the aspect ratio of the printable area someblack background always leaks out. I tried making the whitebackground 20 pixels larger than I need (870 x 1120) and thensetting a crop rectangle in addPage of (10,10,850,1100), no luck,the black stage background just fills in the area outside the crop.A simple solution would be to temporarily set the stage backgroundcolor property to white, print, then set it back to black, but I

View 1 Replies

ActionScript 3.0 :: Background Caches And Flashes On New Uploaded SWF As Background

Aug 2, 2010

When I click on the next button that loads a another swf the background from the previous swf flicks on the screen.click on the attached link URL..[code]I would like the "current_ plan.swf" to load so that the over lays (no so much on the views but more in the LIVING MASTER.We are creating this for both touchscreen and web(the link is the working touchscreen version hence the files being large).[code]

View 7 Replies

Professional :: Background Scrolling - Attach The Trees To The Background?

Nov 19, 2010

I have converted a large background image (much larger than the stage) into a Movie Clip.  I did this so I can make it scroll as the player traverses to the edge of the scene.This appears to make the player free to roam the entire background image.I have a tree symbol with a class attached to it that blocks player movement.Here is my problem:

When I drag and drop instances of the tree symbol onto the background, the trees are stationary and do not scroll with the background.I do not want to have to implement code to make the trees scroll when the background does.I was wondering if there was a way to simply attach the trees to the background so that if the background moves, the trees move with it and appear to be part of the background as if they were drawn into it.It is convenient for me to be able to drag and drop as many trees as i need to block certain routes on the background from the player.I tried writing code to make the trees move but it was only working for the very last tree that I added to the scene.

View 8 Replies

Scaling Background / Whole SWF Object Without Tiling Background

May 15, 2009

I really don't know much about flash or swf files but in updating my portfolio I came across Polaroid gallery. I have managed to update the background jpeg with my own picture and remove the fade effect. However in the original program the background was tileable so when seen in a full screen browser looked fine. As my picture is not tileable I would like to know if it is possible to scale the background or the whole swf object without tiling the background.

View 1 Replies

Image As Background / Resizing / Scalable Background

Jul 24, 2009

I am relatively new to Flash CS3 and i have been learning Action-script 3 over the past week. I have come quite a long way and i have made a site in flash but i just have a question.I have been using an image as my background and i am happy with the way flash automatically scales all the objects in my file but the background image does not scale. Is there a way to do this? I have found out things online which show me how to add auto-resizing to the background but this knocks off the flash auto scaling/resizing for everything else.

View 4 Replies

Background Controlled By Navigation (Dynamic Background)?

May 26, 2009

create an effect that loads a fullscreen background image that changes according to the navigation selection. The background will be replaced everytime the navigation is activated

View 1 Replies

ActionScript 2.0 :: Corresponding Background MC Come To The Top Of The Pile Background?

Dec 11, 2007

I have a series of background MCs, all different coloured gradients (pretty!), and a series of corresponding buttons elsewhere on the stage. On a press of each button I would like the corresponding background MC to come to the top of the pile of backgrounds, then fade in above the previous background. The background that was previously on top, needs to stay next-to-top.If the corresponding background is already at the top of the pile, then nothing needs to happen.

At the moment I am using swapDepths(1) which brings the target to the top no problem, but it may also send the previous top layer MC way down the pile.This is what I'm doing at the moment:

on (release) {
if (_root.BG.colour2.getDepth()<=0) {
_root.BG.colour2._alpha = 0;[code].....

View 14 Replies

Flex :: Objects Drawn By Flash Graphics Class Exist As Objects?

Jan 16, 2011

Internally Flash obviously keeps a list of the primitives drawn using Graphics so I wondered if you have many such primitives in a Sprite, can you re-position/remove/alter individual items rather than clear and re-draw everything? Or is this deeper into the bowels of Flash than you're allowed (or recommended) to go?

View 4 Replies

Php - Flex Is Deserializing Generic Objects From Zend AMF Instead Of Strictly Typed Objects

Mar 4, 2012

I'm using Zend AMF to send my remote objects to Flex. I've defined a Constant class and created getASClassName() method. Then I've created Action script class in flex.

Objects are send successfully, but they are deserialized to generic Objects in Flex instead of specific ones. EDIT: On network monitor in Flex I can see that AMF value is set to com.my.project.valueobjects.Constant. Although array from event.result contains Objects.

[Code]...

View 1 Replies

ActionScript 3.0 :: Does Setting An Array Of Objects To Null Erase The Objects From Memory

Apr 27, 2010

I have an array of temporary objects created in a for loop. The objects are of type class "Tile", a class I created. However, it appears that whenever I create a lot of tiles in the for loop, the program slows down indefinitely.

While the array is whiped at a later trigger point, I am thinking that perhaps these Tile objects are not being erased from memory. They are being created on the fly in a for loop, and the array is being reset to "array = []".

Are the objects still in memory or are they cleaned up when the array is set to []?

View 3 Replies

ActionScript 3.0 :: Objects Class Find And Change Another Objects Xy Properties?

Oct 13, 2010

What I have is a game with a Level object, inside the Level is a Player object, and they don't have instance names given, what I'm trying to figure out is how to do is make it so that the player can change the x or y properties of the Level object.
 
To be more precise, I'm making it so that when the player moves in a certain direction, he either moves accross the stage, or he starts moving the Level object around the stage, it'd be in an Event kind of function, now I can easily make the Player move, but I don't know how to make the Level object move which the player is inside of.

View 3 Replies

Flex :: Converting Array Of ObjectProxy Objects To Custom Objects?

Jun 10, 2011

I have a service which returns an Array of ObjectProxy objects. I would like to cast this to a custom object (a value object) and create an ArrayCollection. How can I do this?ited:I am using Django and PyAMF for the backend. I had to write a custom SQL query and I am wrapping the resulting records in ObjectProxy and sending the whole result as an ArrayCollection.Here is my client side code:

[ArrayElementType("SessionVO")]
[Bindable]
private var _list:ArrayCollection;

[code]....

View 2 Replies







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