View Full Version : Gradient Alpha Masking inside Movieclip or external SWF
gLT4FM
09-29-2006, 07:01 AM
I'm trying to create a gradient masking effect for one of my flash applications using the technique described here: http://www.devx.com/webdev/Article/29296. Everything works fine as long as I implement it at the root scene level but if I want to embed the mask and maskee into a movieclip or an external SWF and then add that movieclip/SWF to my main scene, the mask is simply not applied and the two elements appear as solid objects.
Has anybody experienced a similar problem? If you have an idea how it could be solved I'd appreciate some help.
FYI, I'm using Flash 8 on Windows and I have Flash Player 9.
random
10-01-2006, 05:52 AM
I have had the same problem. I have tried many things, I read a tutorial once that worked, it masked a movie clip inside of a circle with a radial transparency, and it works, it uses the bitmap caching to acomplish this. Now since it is just creating a bitmap out of your object you should be able to substitute it with a grayscale bitmap to acheive a true 64 bit image with alpha but no such luck. Adobe taunts you saying you can do it.
jakelic
11-05-2006, 04:08 PM
Hi everyone (first post :) )!
has anyone found out the solution to this particular problem? i have exactly the same issue and it's starting to be a huge loss of time and money for me.
the problem, once more, is that gradient alpha masking works perfectly in a single swf, but when calling it from another swf through loadClip, the content (video, in this case) is masked without the gradient transition. please help, anyone!
Thanks
indeago
12-04-2006, 12:31 PM
I had this same problem and it was frustrating as well :mad:
However, after some expirementation I figured out what the problem was.
Bitmap Caching only works if the actionscript is called relative to the _root timeline or the main timeline of movie. When you load a movie clip into your main movie it inherits that instance. So you need to make your path relative to the main movie _root timeline. If you place the actionscript in the external swf, or inside the movieclip instance timeline it wont work! But when you play that external swf on its own it works, or when you put the action on the main timeline and call it to work in the movieclip instance it works...
For my project i had the main movie which loads an external swf.
In the external swf the mask was inside a movieclip instance. My solution was to create a function inside my main movie which had the "bitmap caching masking actionscript" with relative path. Then on the root timeline of the external swf i called the function at the appropriate frame. (frame where the movieclip instance was placed which contained the masking objects and animation.)
you simply create a function on your main movie timeline frame 1.
I called the function opacitymask().
function opacitymask () {
_root.externalswf.animation.clip.cacheAsBitmap = true;
_root.externalswf.animation.mask.cacheAsBitmap = true;
_root.externalswf.animation.clip.setMask("_root.externalswf.animation.mask");
}
"externalswf" is the name of the instance which holds the loaded movie
"animation" is the name of my movieclip instance inside of my loaded swf
where my masking effect was taking place.
"clip" and "mask" are just the names for the masking objects which are to be turned to bitmaps. You guys should already know this if you got the masking script to work.
The key is to call the function on the root timeline of the external swf your gonna load. So you would paste the above actionscript in your main movie, and inside your loaded movie on the main timeline you would have the action "_root.opacitymask();" on the frame which contained the animation movieclip.(the movieclip which contains the mask)
GoodLuck :)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.