This Flash tutorial will teach you how to create draggable dynamic mask. This is similar to the previous dynamic masking tutorial, but this time the mask is draggable. This means you are able to drag your mouse to reveal the layer below, instead of mousing over your masked layer.
This is a continuation of the dynamic masking tutorial. And this will be an alternative for step 5. The previous steps will be the same, but this time I have used an image instead of text for the masked layer.
Draggable dynamic masking
Step 5
On the timeline insert a new layer called “actions”. Right click on the first frame and select actions and enter the following code:
mask_mc.onPress = function () {
startDrag(this);
}
mask_mc.onRelease = function () {
stopDrag();
}
maskedbg_mc.setMask(mask_mc);
**The startDrag(this) makes the mask draggable, so allows the user to drag the mask around. The “(this)” refers to “mask_mc” the object which is draggable. You alternatively put “mask_mc” in the parenthesis if you wish. And the stopDrag() basically stop dragging the object.
Step 6
Test the movie clip ctrl + enter. And drag the mouse to reveal the mask below.
You should have a draggable mask.
Wednesday, 8 October 2008
Subscribe to:
Post Comments (Atom)








3 comments:
Very cool
Do you design flash for clients?
@roentarre
Maybe depends on the scale of the project.
Hey thanks for the post. Found it very useful as im doin this stuff at uni atm.
Post a Comment
Welcome to ilike2flash! If you like this post you can subscribe here to get updates via RSS or opt to have them sent directly to your inbox .
I appreciate your feedback, so please feel free to comment.