AS3 - Alpha Mask Help


I 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? I have the swf set up on the following link:

Full code can be seen below and i have attached the zip with the .fla file:

// Imports.
import flash.display.Sprite;

// Sets masks as false on start up.
maskP1.visible = false;
maskP2.visible = false;

// Load External Image into loader.
var imageP1:Loader = new Loader();
var request:URLRequest = new URLRequest("");
imageP1.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);

function onLoadComplete(event:Event):void {
	imageP1.x = 67;
	imageP1.y = 67;
	imageP1.width = 425;
	imageP1.height = 282;

// Make Loader a Child of Sprite.
var imageP1_Content:Sprite = new Sprite();
imageP1_Content.buttonMode = true;

// Set Drag Function.
imageP1.addEventListener(MouseEvent.MOUSE_DOWN, drag);
imageP1.addEventListener(MouseEvent.MOUSE_UP, drop);

function drag(event:Event):void {
function drop(event:Event):void {

// Set functions for mask scale.

function scale1 (event:Event):void {
	maskP1.visible = true;
	maskP2.visible = false;
	imageP1.mask = maskP1;

function scale2 (event:Event):void {
	maskP2.visible = true;
	maskP1.visible = false;
	imageP1.mask = maskP2;

Please, please help! :slight_smile:

Thanks in advance


Have two clips, one masked, and a duplicate one, unmasked, above the masked one. Set this one to 10/20% alpha and only make visible when the mouse is down.