Flash :: Invert A Mask In It?
Feb 9, 2010I've been looking for a simple way to invert a mask in flash. Its just amazing how it doesn't have this feature.
I just really need to paint shape and whatever is below (in layers) wont show up.
I've been looking for a simple way to invert a mask in flash. Its just amazing how it doesn't have this feature.
I just really need to paint shape and whatever is below (in layers) wont show up.
I'm wanting to render this character as a flash animation (which i will create with swift 3d), could I make the walls of this corridor mask him so that only his head would only be seen as he walked through it, as below?I would later render the animation of walls as normal like so ..lkThrough.html (so that i would have a vector character walking through a bitmap corridor, you may ask why i want to do that, and that's because later on the character will be mainly animating on a still background and i'm trying to conserve download time for the Flash file).
View 0 Replieswell, i was wondering. there is the regular masking way, where we can draw an area and what that drawing catches behind will take the drawing form.but what i was trying to do is the inverse, so that the image from behind will appear, but the masked area will be empty
View 9 RepliesNormally a mask reveals whatever is within the layer below that is overlapped by whatever is on the mask layer. I'm trying to do the opposite. What I'm working on starts with a city street grid. I have an irregularly shaped mask that "grows" from the center, revealing some wireframe city buildings. At the same time I need to remove the portion of the street grid that is underneath the buildings, using the same irregular mask (well, a copy of it, but identical motion/position, growing out from the center). The relevant portion of the street grid is its own movieclip/layer - easy to mask or otherwise manage by itself.
It looks like there is no easy "invert mask" function (and why not, I ask - seems like it'd be pretty straightforward and certainly useful).I'm thinking I could start with a big rectangle and use my mask (at tiny "starting size") to punch a hole in it. Then I could scale the mask until the hole overlapped the street grid completely.
But the problem with that is, then I have this huge mask, and the street grid/city movieclip (which contains all the clips and masks that make up the buildings and street grid) resizes and repositions dynamically to fit the browser window size. The huge mask will change the size of the grid/city movieclip, which will change the way it resizes (basically, Actioscript will now think it's huge so it'll shrink it way down). Is there a way to have Actionscript "ignore" the size of the mask when determining the size and position of the movieclip?Or, perhaps there is a way to resize just the punched-out hole in the middle of the mask, and keep the outer rectangle the same size?How do people usually do this sort of thing - when they need to make something disappear via a "growing" mask?
what i am doing is to make something along the lines of the "scriptable mask" tutorial Inigo was kind enough to put up.My idea is to have a large mask behind the whole of my flash site, this masks a colour image with a black & white one (nothing tricky). The image I am using is actually 5 separate images combined, and each is a pic of certain parts of the site.I also have a very basic set of buttons along the bottom... each corresponding to each section.
All I want is to set it up so that when I mouse over the buttons, the _x of the mask moves to correspond with the correct image... really very basic... or so I thought .If anything it should be easier to do than what is in Inigo's tut (where he uses the _x of the mouse to move the mask)... i just cant seem to get it to work with a nice easing effect (its easy to get the mask to simply snap to each coordinate, but I need it to smoothly move).
Im trying to make the cursor invert so when you go left on your mouse the mouse pointer goes right, basically the cursor goes the opposite way to your mouse. I have no idea where to start or even if its possible. I assume it be a case of hiding the original mouse pointer then using a MC of a pointer which has the inverted movement applied to it?? The inverted cursor also needs to be able to click a button that would put the cursor back to normal. Im using CS5 so either AS2 or 3
View 4 RepliesI currently have a vertical slider that is controlled by the user using startDrag. The puck is restricted in movement by a track movieclip that is 115px high.
[Code]....
i try to invert the mouse movement. when you move the mouse the the left it will go to the right and viceversa. the same for the Y axe.
View 9 Repliesi was wondering if it's possible to invert columns and rows - I need the rows to become columns a columns to become rows.
[Code]...
Problem is becouse number of rows (1,2,3) is changed dynamically. I was trying to create new arrayCollection and use different variations of addItem but non of them works and I'm stuck. Maybe some of you know how to do this?
Is it possible to invert the Y-axis from the cursor? So moving up would move the cursor down?
View 4 RepliesI made a volumeslider, but the problem is that the sound plays at 100% when the slider is down and at 0% when the slider is up.Of course every volumeslider does the opposite. adjust this code so down, the volume becomes 0% and up 100%?
sliderVolume.onPress = function() {
this.startDrag(false,150,150,150,250);
}
[Code]...
hi does anybody know how to make gravity invert or flip when a mc collides with a box?
View 1 Repliesreason is i'm copying this grayscale Perlinnoise smoke image and makig it such that the darker the color, the more transparent it is. (I'musingcopyChannel.RED/GREEN/BLUE->CopyChannel.ALPHA). But right now, it's the other way round at the moment (ie. the brighter the pixel, the more opaque it is.). I want it to be more transparent instead (inversely proportional), so if i could find simple & fast way invert the alpha channel, it would do me so much more good. (I need a fast method...performance is critical!)
View 6 RepliesI 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]...
maybe point me towards a better way to mask. png file is way too big. I have been using the mask layer option to create my own mask around a jpg image by drawing around it on the mask layer. There has to be a fetter and faster way to do this. Is it possible to maybe have a specific color range have an alpha value of 0. Similar to green screening whereas If I put the item I want to clip on a green background flash will auto take out the green for me. and by auto I mean action script maybe. I think this can be done but im not finding it.
how are these guys clipping these images [URL] they have the movie clips set up where the black background on the 3 layers of shoes is getting masked out. When I go into the shoe movie clips I see there is a black background but it just disappears when I go back to main timeline.
ive gotten one movie clip to mask another in the actions frame but i cant seem to be able to mask the flames which are a shape with a movieclip in this as file. im not getting any errors but the mask isnt covering anything look near the bottom at s.mask=mask_mc; there are about 20 "s" shapes spawning per second if that has anything to do with it
Code:
//this package turns an mc into a flaming button that calls a javascript function
package
{
import flash.display.MovieClip;
[Code].....
I was wondering if its possible to mask multiple MC or Sprites under one mask, when using AS3.abc.mask = a;cba.mask = a;something like that
View 2 Repliesmouse move to left and the background move to the left how to invert that mouse move to left and the background move to the right and plus Y axis.
View 2 RepliesHow would I 'invert' the "mouse follow with easing" code bellow - So that my mouse follow is mirrored? ie: when the mouse is at the bottom x=10 y=-50, the MC is at placement is x=-10 y=50 (thus the top) . I am trying to create a moving camera presence with a subtle lighting fx, that reacts to mouse placement.
[Code]...
is there such a thing as an opacity mask in flash? (like the one in illustrator--or something similar?)
View 5 RepliesI need to make a mask, like in photoshop for example, with gray tones which provide particular transparency.I thing that I've seen something like this in the past, so obviously it is possible.
View 2 RepliesI saw one video on how to use flv file in flash and mask it. It is working fine when I am using the following option while importing a video file to flash:
Load external video with playback component
But when I tried with the following option it doesn't show the background, it shows only movie which is playing nicely. But not the background which has a bill board.Embed FLV in SWF and play in timeline.It seems the mask is not working with this option.Actually it should be like the above.But when I am using the option Embed FLV in SWF and play in timeline while importing the flv video, getting the result like below: It is not showing the Bill board as above.See the layers created:
I have created mask layer with single MC cosisting of couple of instaces of another MC. This is a set of growing squares. The problem is that only first instance gives mask effect. Rest of instances are not used to. Does anybody knows what is wrong and how to workaround this (most likely)bug ? I would like to avoid creating one masking MC consisting of e.g. 100 layers - with teened growing sqare on each layer but in different position. Wiser is just to create one MC consisting of many instances of another single MC.Second example describing issue.Mask layer contains shape tween which consist of 3 keyframes.Masked layer contains single keyframe at first frame with one MC. This MCrestarts when middle keyframe in the mask is played. It seems that masked MC (on different layer obviously) is recreated when playhead meets keyframe in mask layer in tweened shape. In the same moment our MC stopped beeing visible for AS3 under given name as well.It seems that if mask layer contains more complex animation then basic shape move/scale then masking stops working properly. Is it bug in Flash palaer or am I doing mistake?
View 3 RepliesI have imported to the library two images and have given them the custom class names MaskImage and MaskedImage.[code]...
View 1 RepliesSo i have this sprite that is say arbitrarily 100 x 100 which is added to the stage. Now when content is added to this sprite the sprite expands automatically as it should. I dont want this to happen, what i want is to set a defined boundary i.e. 100 x 100, if too much content is added i can be able to scroll it. My problem is i cannot add a mask to the stage like the conventional way because i have many other boxes like this that vary in dimensions and number. I found a way i can do this but its very inefficient, what i did is i created a movieclip filled it say 100x100 with some color then instantiated it. Next i added the sprite and if content overlaps it wont be visible, only 100x100. I sort of stumbled on this and dont know exactly why this works. Any help is well appreciated, thank you.
[code]...
I'm trying to add an overlay over my main scene in Flex, with a see thru.
The idea is that users can only interact with the elements exposed thru the Ellipse.
Here is my code:
<!-- Our black overlay -->
<s:Graphic width="100%" height="100%" cacheAsBitmap="true" mask="{this.focus}"
maskType="{MaskType.CLIP}">
[Code]......
I am bumping into a very strange behaviour on Flash.If you on the Flash IDE create a shape with a mask associated to it, save it and then export it as a swf, you cannotprogramatically know there is a mask (displayObject.mask is null)
Here's a simple test script to prove that:
//executed on enter_frame with the root object
function test(d:DisplayObject) : Void
[code]....
This work:
var a:BitmapData = new BitmapData(640,480);
var b:Bitmap = new Bitmap(a);
a.draw(movieClip);
[Code].....
How can I draw in my Bitmap just the visible part of a MovieClip that uses mask?
I was trying to set up a gradient mask in cs4 yesterday but I cant seem to figure it out, its not the same code as in cs 3 and I cant seem to find anything online? (URL...)So can anyone please tell me in short how I can do that?Url...
View 1 RepliesHow do i mask duplicatedMovieClips with flash mx.
i have looked around but still can't see a simple example..