Mask Not Working

Hi;
I have the following code:
        var mask_container:Sprite = new Sprite();
        var square:Sprite = new Sprite();
        var thermometerMask:Images = new Images();
        // "Images" is imported and works. Explain further later
        private function init(e:Event)
            addChild(mask_container);
            mask_container.addChild(thermometerMask);
            addChild(square);
            AddText();
        private function AddThermometerMask():void
            thermometerMask.ImagesArray = ["images/thermometer-mask.png", "index.py", 144, 1152, (stage.stageWidth-144)/2, 23];
            AddRed();
        private function AddRed():void
            square.mask = mask_container;
            square.graphics.beginFill(0xff0000);
            square.graphics.moveTo(0,0);
            square.graphics.lineTo(75,0);
            square.graphics.lineTo(75,504);
            square.graphics.lineTo(0,504);
            square.graphics.endFill();
            square.x = (stage.stageWidth-74)/2;
            square.y = ((stage.stageHeight+458)/2)-83;
The problem is that the mask isn't applied. Now, if I just add mask_container it adds to the stage just fine. If I mask mask_container with square, it masks just fine. They're both Sprites so both are on the display list. What gives?
TIA,
Beno

I would have thought anything I put in a sprite would be fine since it's part of the display list. And the image does show up when added as a child and not as a mask. Here's the code for that class:
package  {
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.filters.*;
    import flash.filters.BitmapFilterQuality;
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.display.Loader;
    import flash.display.LoaderInfo;
    import flash.display.DisplayObject;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    public class Images extends MovieClip
        private var parent_container:Sprite = new Sprite();
        private var _path:String = new String("path");
        private var _myWidth:Number = new Number(20);
        private var _myHeight:Number = new Number(20);
        private var _myX:Number = new Number(20);
        private var _myY:Number = new Number(20);
        private var _myURL:String = new String("url");
        public function Images():void
        public function set ImagesArray(_imagesArray:Array):void
            _path = _imagesArray[0];
            _myURL = _imagesArray[1];
            _myWidth = _imagesArray[2];
            _myHeight = _imagesArray[3];
            _myX = _imagesArray[4];
            _myY = _imagesArray[5];
            LoadImage();
        function LoadImage():void
            parent_container = new Sprite();
            addChild(parent_container)
            var req:URLRequest = new URLRequest(_path);
            var loader:Loader = new Loader();
            loader.load(req);
            loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);         
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, LoadedImage);
        function LoadedImage(e:Event):void
            var loaderInfo:LoaderInfo = e.target as LoaderInfo;
            var displayObject:DisplayObject = loaderInfo.content;
            displayObject.width = _myWidth;
            displayObject.height = _myHeight;
            parent_container.addChild(displayObject);
            parent_container.x = _myX;
            parent_container.y = _myY;
        function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
Any ideas?
TIA,
Beno

Similar Messages

  • Mask not working correctly?

    Hi every one!
    I have this problem with my mask not working properly, i have an image, and it has an red fruit sitting on a table,
    i have to make the picture sepia using an adjustment layer ( my lecturer says it MUST be done that way)
    but leaving the fruit as red as possible. So when i do this i MUST use the layer mask provided by the
    adjustment layer, but what is happening is the orange is going a very faded red ( but not quite sepia), the table BG does go sepia..
    so its KIND OF working but not really.
    Cheers
    Bunny Face

    Check your mask by OPTION CLICKING on the mask icon on the specific layer. This will show you a greyscale mask. BLACK hides, WHITE REVEALS. SO obviously grey does half of each! So if you dont want the apple to be affected by the layer mask you  must paint it BLACK in the mask of that adjustment layer.

  • (three-way color corrector) secondary color correction masks not working?

    Hi I'm using PP 2014 on Yosemite. Anyone notice (three-way color corrector) secondary color correction masks not working?

    strange. same stats here but im getting intermittent.... sometimes i can use the mask and the effect is only limited to the masked area. most of the time the masked area is ignored and the effect is applied to the whole image

  • Help - Simple mask not working in Flash CS4

    Hi everyone,
    Thanks for taking a minute to read my post.
    I am creating a very simple mask using motion tweening. I created some text on a layer and made it a masked layer. Then I created a mask layer which consists of a circle that will span across the text. When I play the movie the circle does not show up at all in the frames the mask layer spans (it's purple on a black background) and the circle does not move across the text like I told it to with the motion tweening. I don't know why it's not working. For some reason the circle isn't showing on the stage at all and it's not moving across the text. I don't know if I have it set up wrong on the timeline or what. Here's the steps I followed to create the mask:
    1.insert a new layer in which I named it mask and click frame 1 on this layer
    2. select the oval tools on the tools panel and set the stroke to none
    3. set the fill color to purple
    4. draw a circle and click the selection tool and drag a marquee around the circle to select it.
    5. click insert on the menu bar, click motion tween then click ok in dialog box about converting it to a symbol to be tweened
    6. click the last frame in the mask layer and drag the circle to the end of the line of text
    7.click mask on the timeline to select the mask layer, click modify on the menu bar, point to timeline then click layer properties
    8. verify the show check box is selected in the name section, click the lock check box to select it, click the mask option button in he type section, then click ok.
    9. play the movie in which the circle object covers the text on the masked layer as it moves across the stage
    Thanks for your help!
    ashmic19

    Update 8-2-10: In play mode the text was still visible when it shouldn't be but once I tested the movie the mask worked correctly with the text. So problem solved
    -ashmic19
    Thanks for all who viewed this. I finally figured out why it wasn't working. I had the mask layer locked. But now the circle is moving across the text but the text is viewable when it shouldn't be until the circle moves across it. How come it's doing this?
    ashmic19
    Message was edited by: ashmic19
    Message was edited by: ashmic19

  • Mask not working correctly in swf

    Hai Friends,
    I am trying to do a simple masking which works correctly in
    fla but when viewed in swf the text which is masked is not
    seen..What i did is first i wrote some text converted it to
    movieclip then in another layer i did draw a rectangle with some
    color and right clicked the rectangle and masked it When viewed in
    fla the masked text is viewable but when converted to swf the text
    is not seen Is it some problem with Flash Can you please help me...

    Text is not able to be masked in Flash by default.
    You CAN do this IF you embed your text (or simply break it
    apart into vectors if it doesn't need to be dynamic).
    To break apart - select your text and hit Ctrl+B twice (Cmd+B
    on Mac). This will make the text vectors, thus negating the
    problem.
    Otherwise, you need to embed the fonts in 2 ways. First, if
    you like, you can click the "Embed fonts" button in the properties
    panel, and select what to embed. OR, you can go to the Library's
    drop-menu and select "New Font" - choose your font, and click OK.
    Either of these methods embeds your font. BUT, there is one more
    step. You need to give your text box an instanceName, go to the
    actions panel, and enter the following:
    myTextBox.embedFonts = true;
    This will finish the embed process to allow the masking (and
    alpha changes) to work for the text.

  • Mask not working on loaded jpg

    Hi,
    I have a blank movie called "shell" on a frame, which is
    where I load the jpg. - shell.loadMovie("1.jpg");
    Above that the frame that contains the shell movie, I have a
    mask layer. Once the jpg is loaded, I have a shape animation on the
    mask layer that reveals the jpg.... but for some reason it doesn't
    work. If I take away the mask layer it displays properly.
    *UPDATE*
    The mask stops working when the shape tween starts. Initialy
    the masks works when there is no tween on the mask layer.

    Thanks - your example worked for me. Not sure why I couldn't get it to work before. I think it was because the mask and the item were the same exact size as well. I created another example and posted below which is what I was going for.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute">
        <mx:Canvas width="300" height="30" horizontalCenter="0" verticalCenter="0">
            <mx:ProgressBar
                id="prog"
                label="1234"
                width="300"
                height="30"
                indeterminate="true"
                labelPlacement="center"
                mask="{maskCanvas}"/>
            <mx:Canvas
                id="maskCanvas"
                width="295"
                height="20"
                backgroundColor="#000000"
                borderColor="#000000"
                borderStyle="solid"
                cornerRadius="10" horizontalCenter="0" verticalCenter="0"/>
        </mx:Canvas>
    </mx:Application>

  • Inverted layer mask not working

    I havent used PS much of late but in CS6 when layer masking the technique I used to use doesnt seem to work anymore.  I would have two layers.  The top layer I would put a layer mask.  Then I would select all and delete hit the delete button so the mask would turn black and invert.  Then instead of painting black over white to reveal the bottom layer I would paint white over black to bring my top layer back.  I liked doing it like this.   But its not working now.   When I paint with white on the black mask nothing happens?? I tried inverting in the properties but makes no diff.   What am I doing wrong?

    Check the blending mode on your brush.  It may be set to darken or some other blend mode than normal.  As a side note, you can invert a layer mask be making sure it's selected and press ctrl/cmd-i. You can also create a mask where everything is hidden by pressing alt/opt then clicking on the add layer mask icon in the layers pallet.

  • CS5 Layer Mask not working. Hide all not hiding

    I need some help here. CS5 on win 7 64 bit. Duplicate layer and apply a layer mask (alt click) and it does not hide the layer. Just applying a mask and painting with black also does not hide. If I hide the background layer then the mask appears as the white and grey checkerboard pattern, no solid color. Am I missing something simple?
    Thanks, Dave

    The checkerboard indicates places where your entire document is transparent through and through.
    I suspect your mask is working as it's supposed to, and that when the background layer is visible you're just seeing through to the duplicate layer below - which by definition will not look any different on your display.
    Try this:
    Add a brightly colored solid color fill layer just below the layer you're masking.  Now see what the mask does to the upper layer.
    -Noel

  • Properties panel for masks not working

    The apply, disable and delete buttons on the properties panel for masks does not work in PSD CC. Is this a bug or do I have some setting not set correctly? If I want to apply a layer mask I have to drag it to the trash in the layers panel then make a choice on a popup menu. They worked in CS6.

    I don't know exactly what is going on with your friend's system, but the instance you mentioned of Applying layers masks, was actually a safety error trap.  i.e. Do you really want to trash this layer mask or do you want to Apply it before deleting it.
    In CC the Adjustment layer, and Masks share the same Properties panel, so you have to have a mask selected to view the masks panel.  It all works sensibly IME.  As I said above, you were coming at something a bit left field.  That's not necessarily wrong.  Whatever workflow works best for you is best for you, but there might be better ways to do things.
    A lot of us rail innitially at changes to apps we have used in a certain way for many years, but IME they always turn out to be for the better once you get used to them.

  • Black brush on layer mask not working. Please help/

    I have been using CS6 for a while now.  CS 6 decided that I can't use my black brush on a white layer mask. At all. I can use the white one on a black mask, but not the black one I.  I restarted the computer, but I am annoyed. Has anyone has this problem?  Solutions?  I am so over my head with photos to finish...this was going to be my big weekend to work at night.

    Look at Options bar. Is the brush in Normal blending mode?

  • 4.2 blob download format mask not working

    I am using Apex 4.2
    I have been working through the book Beginning Oracle Application Express 4. In chapter 6 the a blob is added to a report.
    I have pasted the code example into the report definition (albeit with my own page numbers) :
    SELECT
       "TICKET_DETAILS"."TICKET_DETAILS_ID" "TICKET_DETAILS_ID",
       "TICKET_DETAILS"."TICKET_ID" "TICKET_ID",
       "TICKET_DETAILS"."DETAILS" "DETAILS",
       "TICKET_DETAILS"."CREATED_ON" "CREATED_ON",
       "TICKET_DETAILS"."CREATED_BY" "CREATED_BY",
       dbms_lob.getlength("ATTACHMENT") ATTACHMENT
    FROM
       "TICKET_DETAILS"
    WHERE (("TICKET_DETAILS"."TICKET_ID" = :P5_TICKET_ID))
    I go to the report attributes and click on the attachment column.  I enter the suggested format mask
    DOWNLOAD:TICKET_DETAILS:ATTACHMENT:TICKET_DETAILS_ID::MIME_TYPE:FILE_NAME:::inline:Download.
    When I press apply I keep getting :
    1 error has occurred
    "" not found. (Go to error)
    I have confirmed that the query runs and that P5_TICKET_ID does exist on page 5.
    Not understanding what this meant I tracked down this page
    17.10 About BLOB Support in Forms and Reports
    and the section "Providing a Download Link" seems to confirm that the above format mask is correct.
    Any pointers would be greatly appreciated.

    I've also done the exercises in the book and it worked for me.
    Your format mask is correct. But before pressing submit you also have to enter the blob column attributes:
    *Format Mask (Value Required):                   DOWNLOAD
    *Blob Table (Value Required):                       TICKET_DETAILS
    *Blob Column (Value Required):                   ATTACHMENT
    *Primary Key Column 1 (Value Required):     TICKET_DETAILS_ID
    Primary Key Column 2:
    Mimetype Column:                                      MIME_TYPE
    Filename Column:                                       FILE_NAME
    Last Updated Column
    Character Set Column:
    Content Disposition:                                    ATTACHMENT
    Download Text:                                           Download
    Maybe you forgot that?

  • Gradient Transparency Mask not working

    Hey there.
    I am working with Flash 8 trying to create a gradient mask
    effect with 2 images and a headline. I have created this effect 2xs
    already for the border of the page. I used 2 movieclips, gave them
    instance names, checked "runtime bitmap caching", and added a
    string of AS: maskee.setMask("mask"); Like I said the first 2 work,
    but I've been trying to add another one for hours and it just won't
    work!?! I even brough all the elements of the 3rd one into a new
    document and it works fine the way I'm doing it!! The file size is
    not enormous. Has anyone else heard of this issue? Any
    solutions!?!?
    Thanks!
    -ms.Lee

    ha! i totally figured it out! you have to have the code (in
    your actions layer of course) on the same frame as the first
    keyframe of the item to be masked. geez, that only took me 3 hours
    to figure out!! well, hope it helps someone else save sometime.
    toodles!
    -ms.Lee

  • Clipping Mask not working

    Okay, so I am EXTREMELY new to this (I started about an hour ago!) I am trying to make a clipping mask with the mask being the outline of France and the image inside the French flag. Here are the steps I've taken so far:
    File>New
    Open>Silhouette of France (photo)
    Image trace as silhouette>Expand.
    Drag in to new file.
    Open>French flag (photo)
    Drag in to new file and put in separate layer to the silhouette.
    Place the silhouette on top of the French flag, select all, make clipping mask.
    Then everything goes white!! I can still see the outline, paths etc. of the silhouette but I just don't understand what I'm doing wrong! If someone could explain it to me in layman's terms that would be amazing because I really don't know what I'm doing!
    I'll include the pictures I am using and the end result I keep getting...

    SoBo,
    The France parts seem to be a Group rather than a Compound Path. It would be better if you could expand the Layer(s) completely, also expanding the Group.
    As I said, an Opacity Mask may be more forgiving, and work with a Group.
    I took the France parts to have no stroke and a white fill, if not, you may give it one (or a black fill), then (the Invert Mask suggested in post #2 was based on a black fill, sorry):
    1) Select the two parts of France and Object>Group or Object>Compound Mask>Make;
    2) Select all and in the Appearance palette flyout click Make Opacity Mask with Clip ticked and Invert Mask unticked (ticked if the fill is black).
    From the OP:
    Drag in to new file and put in separate layer to the silhouette.
    To have it in the same layer, just have one Layer and File>Place the flag image into it, then the France image, and take it from there.

  • Dynamic mask not working once loaded

    I have a movie that has a dynamic mask in it. Once I load
    that file into my other movie, it no longer works.
    I am not even sure to start to look. It makes no sense to me.
    Any ideas?
    Thanks a lot!

    re-assign the mask after loading is complete.

  • Secondary colur correction mask not working! Help!

    I am currently working on Premier Pro CS6 editing a music video. I have edited my footage, fixed the tonality and I am now onto color grading it. I took the saturation down to take out the colour and applied RGB curves to add blue into the shadows and then another fast colour corrector to give the video a blue/black depressed feel.
    Going through my footage I wanted to take out certain colours that were too vibrant still. So I thought to make a mask. This is where my problem starts. I open up the three way colour corrector and the RGB curves and go down to secondary color correction and go to mask. When I try to take a sample from the dropper Premier doesn’t pick up the colour from where I want but selects it in other areas of the footage but never on the area I want! I have tried this on my mac book pro and the same is happening. When I have tried it on rushes it seems to work. I don’t understand why it doesn’t work when I have colour graded my footage?! I have tried many different discussions but nothing is pointing me forward. If anyone has any idea of why this is happening and how to solve my problem I would be so thankful!

    Hi ACD,
    After Effects and Photoshop CS6 take .Looks via the LUT engine. That indeed allows for using primaries with low mid high differentiation and should yield really good results.
    Secondaries can be expressed in a LUT as well, but I would typically not recommend using them when you want to integrate .Looks with your After Effects workflow. Here's why:
    - a LUT is never as precise as you'd want it to be for something as complex as secondary color grading - a LUT is always based on interpolation (as opposed to applying the effect in SpeedGrade - there it's all native, no interpolation at all)
    - For a good key you would typically use the denoise and the blur function in the secondaries. Both (by nature) don't translate at all into a LUT, so you'd have to give up using these 2 important tools
    - For a lot of work you'd want the LUT to be accompanied by a mask. That's something that also can't be described in a LUT.
    Think of the LUT support for .Looks you created in SpeedGrade more as a really helpful tool for matching your comps to an overall look you design, not necessarily as the tool to apply a final grade.
    Hope this is helpful.
    Pat

Maybe you are looking for

  • Acrobat Pro Extended 9 crashes when searching large directory

    I use the "Edit - Search - All PDF Documents in" Search capabilities a lot and it crashes every time. A recent crash occurred after reaching 320 hits in 65 documents in a directory with over 2250 documents (including subdirectories).

  • PL/SQL with synonym - bizarre problem

    I have a strange problem. I have a synonym, which points to a remote table in a linked database. I can issue SQL queries using the synonym and get results back, everything perfectly ok. But when - in the same session - I try to compile a PL/SQL proce

  • Lost favorites in safari

    I have been continually losing my Favorites in Safari.  They just seem to disappear every so often.  They were all there yesterday and today they are gone.  Any help would be appreciated.

  • What is the SITE_TOKEN

    Hi, I have developed an application for Single Sign on administration, I want to add new partner applications using my app, but I have to insert the SITE_TOKEN field in the ORASSO table. Any Idea how to get it?. Thanks. Carlos

  • Switch ipod from windows to mac

    I'm a novice. pls help...I set up my ipod for use with my pc and now want to switch it to use it with my mac laptop. How do I proceed? Thanks.