oddball25 Posted September 10, 2010 Share Posted September 10, 2010 Hi 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: http://www.tiltworld.co.uk/TH785RFD/myDrag.swf 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("http://www.tiltworld.co.uk/TH785RFD/image.jpg"); imageP1.load(request); addChild(imageP1); 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; imageP1_Content.addChild(imageP1); addChild(imageP1_Content); // // Set Drag Function. imageP1.addEventListener(MouseEvent.MOUSE_DOWN, drag); imageP1.addEventListener(MouseEvent.MOUSE_UP, drop); function drag(event:Event):void { imageP1_Content.startDrag(); } function drop(event:Event):void { imageP1_Content.stopDrag(); } // // Set functions for mask scale. _10x10.addEventListener(MouseEvent.MOUSE_UP,scale1); _20x20.addEventListener(MouseEvent.MOUSE_UP,scale2); 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! Thanks in advance John [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/213050-as3-alpha-mask-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.