SEARCH YOUR SOLUTION HERE  

How to ignore masking on one particular child

Hi ,

I was working with masks today and something was bugging me... For example, I have a Movieclip and 2 Childs:

- Parent: Movieclip
- Child of Movieclip: Mask
- Child of Movieclip: Shadow

Now, Mask is working properly for Movieclip and is also applying the mask effect to Shadow. I would like Shadow to stay behind Movieclip but to ignore the Mask effect.

Is it possible Or should Shadow be adopted by Stage instead of Movieclip

Posted On: Thursday 25th of October 2012 11:16:53 PM Total Views:  370
View Complete with Replies




Related Messages:

Can't get setInterval to work properly (it's ignored after the first time)   (136 Views)
I have a movieclip with this code, it's supposed to go sleep-1 once every second. However when the program is run, it waits 1 second as supposed to before subtracting 1 from 'sleep' the first time, but the after that it completly ignores the setInterval and just keeps subtracting without delay. I thought clearInterval would help but it didn't. Any ideas
Flash printJob ignores htmlText with font face declaration   (106 Views)
so I am trying to print a string with html formatting. Part of the formatting includes font face. I have found that my print job will not print ANY string that includes a font face declaration. I'm guessing because the font isn't embedded, but I'm not positive. this works: string = "bold not bold"; doesn't work: string = "this is my string"; How can I get around this. I need the ability to print any font on a users computer.
Extending MovieClip makes clip to ignore frame actions   (124 Views)
Hi: When we want to know if a MovieClip animation has ended, we use to listen the enter frame event and check if current frame is the final one (where the movieclip frame has a stop). But we've thought on a new idea: to extend MovieClip and override stop method. In the override we dispatch an event indicating the animation is ended. So, we hope the clip to find a stop in a frame, call the overriden method and execute both, the super.stop() and the event dispatch. Our result is that the movie clip ignores any stop in its frames. Why is it happening Is there any way to do it TIA
BitmapData masking   (147 Views)
I'm trying to create a bitmap from all of the objects on the stage, then I want to apply a blur filter to it, create a movieclip from it, and then put a mask on that movieclip. What I'm trying to do is simulate the effect you get in newer first person shooter games (like COD 4) where you zoom in and everything but what you see in your gun sight is blury. What the problem is: When I try to apply the mask to the movieclip that has the blurred bitmap in it, in each frame Flash draws and blurs the bitmap based off of the previous bitmap, so it get's progressively blurrier until the whole screen is black. Here's the .fla file: http://www.mediafire.com/33hnnybjcxt Here's my code: Code: stage.addEventListener(Event.ENTER_FRAME, enterFrame); stage.addEventListener(MouseEvent.MOUSE_MOVE, moveCursor); Mouse.hide(); var cursor:MovieClip = new orb(); //this is the gun sight, similar to the Aperture sight in COD5 cursor.x = stage.mouseX; cursor.y = stage.mouseY; var bd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0x000000); var b:Bitmap = new Bitmap(bd); var bf:BlurFilter = new BlurFilter(12, 12, 2); var cm:MovieClip = new cursorMask(); //this is a giant rectangle with a black fill with a circle taken out of the center that's the same size as the gun sight cm.x = stage.mouseX; cm.y = stage.mouseY; var bmc:MovieClip = new MovieClip(); bmc.addChild(b); addChild(bmc); addChild(cm); addChild(cursor); //bmc.mask = cm; //If you uncomment this, the problem happens function enterFrame(e:Event):void { bd.draw(this); bd.applyFilter(bd, new Rectangle(0, 0, stage.stageWidth, stage.stageHeight), new Point(0,0), bf); } function moveCursor(e:MouseEvent):void { cursor.x = stage.mouseX; cursor.y = stage.mouseY; cm.x = stage.mouseX; cm.y = stage.mouseY; e.updateAfterEvent(); }
lib-linkaged-BitmapData ignores the width and height?   (113 Views)
Well, I have a bitmap imported to my lib, and I linkaged it with a name "PNGBitmapData", Then I can use new PNGBitmapData(WW,HH) to create this bitmap, it's very convenient. But as the constructor of "BitmapData" receives two parameters as width and height, i can specify the size of this PNG image. But no matter what number i use, even (0,0), the bitmap is just shown there. Nothing is different. So, are these numbers just ignored by the FlashPlayer
Help: How to ignore mouse events from children   (129 Views)
I am having a problem with mouse events which I would appreciate any help with: In my game there is a podium which at some point can have people on it which are added as children. There is a mouseover event listener on the podium to bring up a rollover box. I only want this rollover to appear when the mouse is over the podium graphic. I have the following setup: Podium Sprite: (Children )-> graphic:Sprite ( visuals for the podium ) -> person:Sprite ( a person on the podium)(children) -> graphic:Sprite ( visuals for person)Now the problem is, the person graphic overlaps and extends beyond the podium one causing the rollover area to popup when the mouse is outside of the podium area if its over the perseon sprite. I have tried mouseChildren = false on the podium but I have found that this just makes the target of the event to be the podium rather than person. Thank you for any tips on this.
My Flash application ignores crossdomain.xml. Help!   (124 Views)
Kirupians, With a looming deadline for a big project, I've just wasted an entire evening trying to find out why my application won't properly load image content when the .swf is deployed to a web server. Here's what I'm trying to do: - load a jpeg image from a different domain than where my .swf's are hosted - turn it into a Bitmap object to apply smoothing Loading the jpeg itself is no problem, as long as I do this: addChild(loader); As soon as I try to access loader.content, or loader.contentInfo.content to create a Bitmap, Flash simply aborts the script. So there you have it: a typical security sandbox violation (although no error is ever thrown). Solution: crossdomain.xml! Or that's what I thought. Now the image host has a crossdomain.xml in it's root, with *.rocketclowns.com as an entry. I'm testing my app from www.rocketclowns.com. Even if I try to force load the policy file: Security.loadPolicyFile() Or, with LoaderContext: [COLOR=#808080][I]// create a loader context that[/I][/COLOR] [COLOR=#808080][I]// checks for policy files[/I][/COLOR] [COLOR=#000000][B]var[/B][/COLOR] context:LoaderContext = [COLOR=#000000][B]new[/B][/COLOR] LoaderContext[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]; context.[COLOR=#000080]checkPolicyFile[/COLOR] = [COLOR=#000000][B]true[/B][/COLOR]; [COLOR=#808080][I]// use the context with your call to load[/I][/COLOR] myLoader.[COLOR=#0000FF]load[/COLOR][COLOR=#000000]([/COLOR]request, context[COLOR=#000000])[/COLOR]; ...I still can't access my loader.content. Help! Is there anything I've overlooked, or am I missing something
Mask in AS3 cross object/multi object masking   (137 Views)
I have a as3 class that loads a number of images from a given location, they are all loaded dynamically with imageloader. However I'm trying to make a Xray screen for all of them, so when I click and drag the Xray screen around, it will reveal the images loaded under each picture, creating a sort of Xray effect. I tried using masks, however since the images are all loaded dynamically they are its own class with its own layers, I'm trying to make a mask that will work for all of them (I load 2 picture for each image, example car.jpg and carb.jpg, b.jpg being the inside image). so I have my stage ---> [MyXray Box, and my Images] so my question is how can I use my Xray Box as a mask for all the Images Since Xray Box is a object of its own, it cannot use its own layers as the mask of another object. How do I do cross object masking
Reverse masking? or something like that   (143 Views)
Hi I am new to the forum I have tried to find what I was looking for on here first but didn't really know what to search for. I am trying to do an image resizing utility in flash. It will take in an XML document with the path to the image and addtional information like the aspect ratio's that may need to be maintained. None of the actual image processing will be done in Flash it will all be done in PHP from the information that will be sent back after processing. My problem at the moment is sorting out the masking technique that will show what parts of the images that will not be used. The image below shows what I am doing, at the moment I am drawing 4 rectangles around the 4 draggable corners, this seems like a really ineffcient way of tackling this problem because it has to continually redraw 4 squares every time the corners are being dragged. I was trying find out if it is possible to do a "reverse mask" of a rectangle to mask anything around an inner rectangle. Alternatively I was thinking of doing one translucent rectangle that covered the 'canvas' area and using another rectangle to delete the area that we will be the image after processing. I dont know if that is well explained at all but I can't really think of a better way of describing the problem. If anyone could help to point me in the right direction that would be really appreciated. ** EDIT ** I have found a way to do it now...
Loaded swf, stops are ignored. cache bug?   (171 Views)
I've loaded a movie in flash, standalone the movie works fine, but when the loader loads it and shows it, the movie works, BUT all movieclips are looping everywhere. The stops are being ignored. It worked fine in the beginning.. but now further in the project it starts showing this bug. I've had this problem when I loaded 2 movies at once, but now it happens with only 1. It seems when the filesize gets too big this problem happens I'm using Flash CS3. It happens on mac and pc. Does anyone have a solution for this
Trouble with masking a layer on a jukebox   (122 Views)
Hi I'm new here, I've been making a jukebox that plays mp3s via an xml file and the playlist is doing strange things (I think it's due to using a flash decomplier, as I lost the original fla file!) I want it to be completely masked by the player body and just show in the lower window, but somehow it's coming out over the top of it. I've tried moving the layers about to compensate for this but it doesnt seem to work, please help!
size too large of masking   (196 Views)
i made a masking anim using frame by frame animation on the mask layer... when i exported the swf it was of 83 kb (too huge) and i checked it was all due to shapes in the mask layer.... i found "eltima swf optimizer" on internet but it gives only black and white output in the demo version .... i opmitized all shapes one by one by using modify>shape>optimize using 100% optimization but when i exported swf this time was 114kb(even more) this sux!!! my question is that is there any other "swf optimizer" that i can use for free... (hey its my school project and i just need to mask a single jpeg) or any other technique i can use.... any help would be great...
Bitmasking Issue   (115 Views)
This function is called on every click to one of four buttons, which are bitmasked into a single value. Each button passes a value (newMask) to be set on clickMask so I can determine which button has been pressed. As you can see below, the values are masked correctly, but it does not ever enter the if block. Performing an AND on the mask correctly evaluates to zero, and I think I'm using "bitwise and" correctly; maybe I'm missing something basic Code with output follows. ActionScript Code: trace(["values", clickCount, newMask, clickMask, (newMask & clickMask)]); if (newMask & clickMask == 0) { ++clickCount; } trace(["clickCount", clickCount]); // set the new flag clickMask |= newMask; /* outputs the following: values,0,8,0,0 clickCount,0 values,0,4,8,0 clickCount,0 values,0,2,12,0 clickCount,0 values,0,1,14,0 clickCount,0 */
Text smearing during unmasking animation   (118 Views)
Has anyone seen anything like this My fellow developers and I here haven't. This animation had been working flawlessly for months, but recently it started doing this on a newer host. The bars animate downward, and the numbers are now leaving these odd "vapor trails." This looks like a rendering issue to me, but if it's somehow tied to un-robust code...
Using BitmapData for masking   (136 Views)
I have a PNG file with transparency imported into the library and converted to MovieClip. Now I want to use this PNG file for masking another sprite drawn dynamically using the drawing API. I know that you cant mask a runtime generated sprite with a author time movieclip. So i created another runtime sprite and copied the BitmapData of the PNG in the library to it. The masking happens, but not the way i want. The BitmapData is always a solid box and the masking apears across this box. I would like to have the transparent region of the PNG omitted from the mask data. Is there anyway I can preserve the transparency information of the PNG when copying the BitmapData so that the masking is as per the PNG and not along the bounding box of the PNG image
loaded clip's timeline code ignored?   (102 Views)
I've loaded a clip (with a stop() and a trace() on the first frame) in my main swf but somehow when it's loaded and added on the stage it neither stops nor do the trace command, here's my code: PHP Code: package{ importflash.display.*; importflash.events.*; importflash.net.*; publicclassCoreextendsMovieClip{ privatevarloader:Loader; privatevarreq:URLRequest; privatevarthe_oval:Oval; publicfunctionCore(){ loader=newLoader(); req=newURLRequest("oval1.swf"); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completed); loader.load(req); } privatefunctioncompleted(e:Event):void{ the_oval=loader.contentasOval; stage.addChild(the_oval); } } } inside the Oval class which is linked to Oval.fla, there's nothing but another trace(). This trace works though.
making mouse events ignore objects.   (216 Views)
How can I make a mouse event ignore, or skip over another object Say I have a small Sprite on a Large sprite, I want it to act as if the small sprite isn't there, and pass the mouse events directly through to the larger sprite behind it. I've been searching for this for a while and have tried various things but no avail. Anyone have any ideas
How to ignore comments in html text   (84 Views)
I have an html file that includes some comments and when I load it into a textField in a Flash movie, there is an empty line where the comment is. How to eliminate the empty line, if I want to keep the comment in the HTML file
Input Text FocusEvent ignores TextFormat   (93 Views)
I am making a simple contact form in as3, but I am having problems formating it. As soon as I use a FocusEvent, as below, it completely ignores the formating which I set Does anybody know why this may be private function onFocus(evt:FocusEvent):void { if(evt.target.text == "Enter here.") { evt.target.text = ""; } } private function onUnFocus(evt:FocusEvent):void { if(evt.target.text == "") { evt.target.text = "Enter here."; } } (I have set the format before this, and have tried re-adding it in the functions)
masking problem   (137 Views)
hey , so i am having trouble getting a png(in bitmapdata form) from my library to mask a sprite that is loaded into the movie via loader. so my setup is: mainThumb : Sprite //empty sprite to contain bitmap loaded via loader thumbMask : Sprite //sprite from the library that contains a png to be used as a mask for mainThumb overlay : Bitmap //some effects to overlay image thumb : Bitmap //bitmap loaded using loader to be added to mainThumb from library: Thumb_Mask : Sprite //the sprite in the library containing the png Thumb_Overlay : BitmapData and the code (that isn't working) Code: function init(e:Event) : void { //called from contentloaderinfo's Event.COMPLETE var thumb:Bitmap = e.target.content; thumb.smoothing = true; mainThumb = new Sprite(); mainThumb.addChild(thumb); var overlay:Bitmap = new Bitmap(new Thumb_Overlay(0,0)); var thumbMask:Sprite = new Thumb_Mask(); mainThumb.x = overlay.x = thumbMask.x = -mainThumb.width/2; mainThumb.mask = thumbMask; this.addChild(mainThumb); this.addChild(overlay); ... i feel like this should work... but it doesn't, nothing shows up at all using this code, but when i try commenting out the masking line, and adding addChild(thumbMask),the mask shows up in the correct position any ideas why this isn't working thanks a ton edit: when i add the line, mainThumb.cacheAsBitmap = true, i see mainThumb but it is not masked...