Gradient mask in Flash?
- Started
- Last post
- 10 Responses
- fyoucher10
Here's a quick sample I whipped up >
http://www.davi-t.com/misc/qbn/a…FLA's and shit...>
http://www.davi-t.com/misc/qbn/a…
- fyoucher10
Couple of ways to do it.
Manual way using blending modes:
- Create two clips. A clip that you want to mask. And another clip above that clip which will be your mask (it can be a static mc or an mc with a bunch of shit animated inside).
- Set the mask clip's layer mode to "Alpha".
- The mask clip can be whatever you want. Literally. Transparent areas within that clip (0% alpha) will not show anything. Things that are 100% alpha will show 100% of the shit. Places where you don't have anything will show at 100%. TIP: I usually put a layer at the bottom of the mask clip which is just a big rectangle at 0% alpha. Then I layer things of 100% alpha on top of it, or gradients, or whatever you want.
- Set the mask clips "cacheAsBitmap" prop to true. You can put it inside of that timeline if you want to (this.cacheAsBitmap = true).
- Select both of those clips and create a container clip (nesting both clips into one clip, parent/child). This will hold the clip you want masked AND the mask. Set this parent mc's blending mode to "Layer". Voila. Do this all of the time.That's the manual way to do it. This works well for more complicated mask animations. More than just one gradient sliding across. You can literally put a ton of shit in that mask clip.
Then there's the code way. See Noneis's post above.
- NONEIS0
package {
import flash.events.*;
import flash.display.*;public class maskTest extends MovieClip {
private var myMask:MovieClip;
private var myMaskee:MovieClip;public function maskTest() {
super();
addEventListener(Event.ADDED_TO... createMask);
}private function createMask(event:Event):void {
myMaskee = new MyMaskee();
addChild(myMaskee);
myMaskee.cacheAsBitmap = true;myMask = new MyMask();
addChild(myMask)
myMask.cacheAsBitmap = true;myMaskee.mask = myMask;
}
}
}
- dbloc0
I'd like to see your version NONEIS
- dbloc0
must be on the main timeline to work
- CyBrain0
I posted a simple example.
http://www.talesfromthehead.com/…You can check the cache bitmap option in the measurements pallet for the mask movie clip and the masked movie clip. The Chet Baker image is there just to show how the transparency works. (Image courtesy of FMT)
- jhey0
- Projectile
Seriously, I've searched youtube, google and qbn and nothing.
No one can tell me how the muthafuck to make a gradient mask in flash. Basically I want a movie clip to look reflected. how??
I found one tutorial
but know nothing about action script. Here's the script I ended up with.. but it didn't work
myimage.cacheAsBitmap=true;
mask_mc.cacheAsBitmap=true;
myimage.mask=mask_mcAnyone know a tutorial? or can teach me? or can tell me where I went wrong?
Thanks