View Full Version : Dynamic Masking
Esquared
09-23-2002, 04:25 PM
Hey guys,
I hope you can help me with this, cause I'm lost.
Here's what I am trying to do. I'm loading one swf into a parent movie, and I want to achieve the effect that I can see through holes in the loaded movie to the parent behind it. Now, I can do this if my mask is static, but I can't for the life of me see how to do it dynamically. For instance, say I have 3 random animated shape mcs on the swf to be loaded, and I want to see through these shapes as holes. I can dynamically position 3 identical shape mcs on the mask layer, which works fine, but of course I then ONLY see the shapes on the loaded movie, and the REST of the movie is obscured. Is there a way to tell the mask to mask in reverse, esentially, so that the areas that have an image are REMOVED, instead of what's left to be seen???
PLEASE help.
THANKS
Esquared
09-27-2002, 12:32 AM
So this has been viewed 58 times with no respose, should I then assume that this is an impossible effect? It seems straightforward, but perhaps it's not as simple as it seems it should be...
pixelwit
09-27-2002, 01:39 AM
It's kind of tough trying to understand what you are trying to do just by reading your description. Maybe you could slap a file together to more clearly define your problem. Barring that, maybe you could show an example of the finished effect as seen on someone elses site.
-PiXELWiT
http://www.pixelwit.com
Esquared
09-27-2002, 07:31 AM
Well, I've honestly never seen this particular effect anywhere else before. BUT, I think I've come up with a fairly clever solution to my own problem. (It always works that way....think for a week, finally post, and then it hits me) I put together a folder containing 2 .flas:
1. DynamicMask_Main with an animated background
2. DynamicMask_Sub which is loaded into DynamicMask_Main, and has dynamic masks within it
The effect I create is that these dynamic masks are "holes" in the Sub MC that allow one to see "through" it to the Main MC behind it once it is loaded.
Anyway, here's the zip file. I also have several comments to make for anyone to note if they choose to look at the actual files:
1. I commented heavily, but you'll have to check each and every MC in both movies to get anything out of it.
2. Just to experiment with what's actually going on, try placing the files in separate directories to see what happens (so they can't communicate) and then look at them together (If they are in the same directory, just play DynamicMask_Main).
3. The effect may be used for loaded .swfs, or simply for multiple animated masks in a single movie. This file is more complex since it includes the loading of the MC and shared libraries as well.
4. Definitely not a simple concept - those unfamiliar with actionscript may be lost easily. If anyone wants/needs more info, just continue this thread and someone can help you out with each area of the file.
5. If anyone sees methods to improve upon the files, by all means do so and let me know about it.
6. THANKS!
pixelwit
09-27-2002, 08:48 PM
Hey, that looks pretty neato. No wonder I was having a tough time understanding what you were looking for, that's a tough effect to describe with words alone.
I didn't examine your FLA files in depth (because I wanted to figure it out for myself) but I'm almost certain my solution is a good bit different from yours. I don't know if it's any better or worse but it does illustrate an alternate possibility.
File attached.
Glad you got everything worked out.
-PiXELWiT
http://www.pixelwit.com
Esquared
09-29-2002, 05:21 AM
Hey-
I took a look at your file...I like the approach. Still, there are differences between the two that make them suitable for different purposes.
1. Yours is PERFECT for using the technique within a single movie. Mine on the other hand uses shared libraries so that multiple loaded .swfs may use the same effect (In my application, I have a main webpage background that can be seen through any of the separate loaded pages). The difference then, is that your focus was on animating multiple masks..which is cool. Mine does this as well, of course, but my FOCUS was creating the "hole" in a LOADED .swf. Communicating between the importing file and the imported file is key here.
2. Your method, while simpler, still uses the "empty hole in the middle of a black field" type of mask. With this in mind, you can animate multiples for sure, but you can't create even more complex effects such as shape tweens on your hearts. Using my method, you use a "black movie clip in the middle of an empty field" mask to create the SAME masking effect. The masks are inverses of each other, but the result is the same. Thus, ANYTHING you can do to an average movie clip can be done to the mask, since they are one and the same.
Let me know if any of that made sense, and take a closer look at mine to see if it all becomes clearer. Hopefully I'll have a beta up soon on SiteCheck so you can all see where this is going...
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.